Class ServerMinPrincipal
- All Implemented Interfaces:
Serializable,InvocationConstraint
The
use of an instance of this class does not imply directly a ServerAuthentication.YES
constraint; that must be specified separately to ensure that the server actually authenticates
itself. Because this constraint is conditional on server authentication, it does not conflict
with ServerAuthentication.NO.
It is important to understand that specifying
ServerAuthentication.YES as a requirement does not ensure that a server is to
be trusted; it does ensure that the server authenticates itself as someone, but it does
not ensure that the server authenticates itself as anyone in particular. Without knowing who the
server authenticated itself as, there is no basis for actually trusting the server. The client
generally needs to specify a ServerMinPrincipal requirement in addition, or else
verify that the server has specified a satisfactory ServerMinPrincipal requirement
for each of the methods that the client cares about.
- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a constraint containing the specified principal.ServerMinPrincipal(Principal[] principals) Creates a constraint containing the specified principals, with duplicates removed.Creates a constraint containing the specified principals, with duplicates removed. -
Method Summary
Modifier and TypeMethodDescriptionelements()Returns an immutable set of all of the principals.booleanTwo instances of this class are equal if they have the same principals (ignoring order).inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this object.
-
Constructor Details
-
ServerMinPrincipal
Creates a constraint containing the specified principal. This constructor is equivalent to calling a constructor with a single-element array containing the specified principal.- Parameters:
p- the principal- Throws:
NullPointerException- if the argument isnull
-
ServerMinPrincipal
Creates a constraint containing the specified principals, with duplicates removed. The argument passed to the constructor is neither modified nor retained; subsequent changes to that argument have no effect on the instance created.- Parameters:
principals- the principals- Throws:
NullPointerException- if the argument isnullor any element isnullIllegalArgumentException- if the argument is empty
-
ServerMinPrincipal
Creates a constraint containing the specified principals, with duplicates removed. The argument passed to the constructor is neither modified nor retained; subsequent changes to that argument have no effect on the instance created.- Parameters:
c- the principals- Throws:
NullPointerException- if the argument isnullor any element isnullIllegalArgumentException- if the argument is empty or the elements do not all implement thePrincipalinterface
-
-
Method Details
-
elements
Returns an immutable set of all of the principals. Any attempt to modify the set results in anUnsupportedOperationExceptionbeing thrown.- Returns:
- an immutable set of all of the principals
-
hashCode
public int hashCode()Returns a hash code value for this object. -
equals
Two instances of this class are equal if they have the same principals (ignoring order). -
toString
Returns a string representation of this object.
-