3050N/A * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <p> This <code>SubjectCodeSource</code> class contains 0N/A * a <code>URL</code>, signer certificates, and either a <code>Subject</code> 0N/A * (that represents the <code>Subject</code> in the current 0N/A * <code>AccessControlContext</code>), 0N/A * (that represent a "subject" in a <code>Policy</code>). 0N/A (
"sun.security.util.AuthResources"));
0N/A * Creates a new <code>SubjectCodeSource</code> 0N/A * with the given <code>Subject</code>, principals, <code>URL</code>, 0N/A * and signers (Certificates). The <code>Subject</code> 0N/A * represents the <code>Subject</code> associated with the current 0N/A * <code>AccessControlContext</code>. 0N/A * The Principals are given as a <code>LinkedList</code> 0N/A * of <code>PolicyParser.PrincipalEntry</code> objects. 0N/A * Typically either a <code>Subject</code> will be provided, 0N/A * or a list of <code>principals</code> will be provided 0N/A * @param subject the <code>Subject</code> associated with this 0N/A * <code>SubjectCodeSource</code> <p> 0N/A * @param url the <code>URL</code> associated with this 0N/A * <code>SubjectCodeSource</code> <p> 0N/A * @param certs the signers associated with this 0N/A * <code>SubjectCodeSource</code> <p> 0N/A * Get the Principals associated with this <code>SubjectCodeSource</code>. 0N/A * The Principals are retrieved as a <code>LinkedList</code> 0N/A * of <code>PolicyParser.PrincipalEntry</code> objects. 0N/A * @return the Principals associated with this 0N/A * <code>SubjectCodeSource</code> as a <code>LinkedList</code> 0N/A * of <code>PolicyParser.PrincipalEntry</code> objects. 0N/A * Get the <code>Subject</code> associated with this 0N/A * <code>SubjectCodeSource</code>. The <code>Subject</code> 0N/A * represents the <code>Subject</code> associated with the 0N/A * current <code>AccessControlContext</code>. 0N/A * @return the <code>Subject</code> associated with this 0N/A * <code>SubjectCodeSource</code>. 0N/A * Returns true if this <code>SubjectCodeSource</code> object "implies" 0N/A * the specified <code>CodeSource</code>. 0N/A * More specifically, this method makes the following checks. 0N/A * If any fail, it returns false. If they all succeed, it returns true. 0N/A * <li> The provided codesource must not be <code>null</code>. 0N/A * <li> codesource must be an instance of <code>SubjectCodeSource</code>. 0N/A * <li> super.implies(codesource) must return true. 0N/A * <li> for each principal in this codesource's principal list: 0N/A * <li> if the principal is an instanceof 0N/A * <code>PrincipalComparator</code>, then the principal must 0N/A * imply the provided codesource's <code>Subject</code>. 0N/A * <li> if the principal is not an instanceof 0N/A * <code>PrincipalComparator</code>, then the provided 0N/A * codesource's <code>Subject</code> must have an 0N/A * associated <code>Principal</code>, <i>P</i>, where 0N/A * P.getClass().getName equals principal.principalClass, 0N/A * and P.getName() equals principal.principalName. 0N/A * @param codesource the <code>CodeSource</code> to compare against. 0N/A * @return true if this <code>SubjectCodeSource</code> implies the 0N/A * the specified <code>CodeSource</code>. 0N/A // if the principal list in the policy "implies" 0N/A // the Subject associated with the current AccessControlContext, 0N/A // handle PrincipalComparators 0N/A // no PrincipalComparator, simply compare Principals 0N/A * This method returns, true, if the provided <i>subjectList</i> 0N/A * "contains" the <code>Principal</code> specified 0N/A * in the provided <i>pppe</i> argument. 0N/A * Note that the provided <i>pppe</i> argument may have 0N/A * wildcards (*) for the <code>Principal</code> class and name, 0N/A * which need to be considered. 0N/A * @param subjectList a list of PolicyParser.PrincipalEntry objects 0N/A * that correspond to all the Principals in the Subject currently 0N/A * on this thread's AccessControlContext. <p> 0N/A * @param pppe the Principals specified in a grant entry. 0N/A * @return true if the provided <i>subjectList</i> "contains" 0N/A * the <code>Principal</code> specified in the provided 0N/A * <i>pppe</i> argument. 0N/A * Tests for equality between the specified object and this 0N/A * object. Two <code>SubjectCodeSource</code> objects are considered equal 0N/A * if their locations are of identical value, if the two sets of 0N/A * Certificates are of identical values, and if the 0N/A * Subjects are equal, and if the PolicyParser.PrincipalEntry values 0N/A * are of identical values. It is not required that 0N/A * the Certificates or PolicyParser.PrincipalEntry values 0N/A * be in the same order. 0N/A * @param obj the object to test for equality with this object. 0N/A * @return true if the objects are considered equal, false otherwise. 0N/A // the principal lists must match 0N/A * Return a hashcode for this <code>SubjectCodeSource</code>. 0N/A * @return a hashcode for this <code>SubjectCodeSource</code>. 0N/A * Return a String representation of this <code>SubjectCodeSource</code>. 0N/A * @return a String representation of this <code>SubjectCodeSource</code>.