|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.constraint.ServerMinPrincipal
Represents a constraint on the server, such that if the server authenticates itself, then it must authenticate itself as at least all of the specified principals.
The use of an instance of this constraint does not imply directly a
ServerAuthentication.YES
constraint; that
must be specified separately to ensure that the server actually
authenticates itself.
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.
AuthenticationPermission
, Serialized FormConstructor Summary | |
ServerMinPrincipal(java.util.Collection c)
Returns a constraint containing the specified principals, with duplicates removed. |
|
ServerMinPrincipal(java.security.Principal p)
Returns a constraint containing the specified principal. |
|
ServerMinPrincipal(java.security.Principal[] principals)
Returns a constraint containing the specified principals, with duplicates removed. |
Method Summary | |
java.util.Set |
elements()
Returns an immutable set of all the principals. |
boolean |
equals(java.lang.Object obj)
Two instances of this class are equal if they have the same principals (ignoring order). |
int |
hashCode()
Returns a hash code value for this object. |
SecurityConstraint |
reduceBy(SecurityConstraint c)
Returns the smallest representable subset of this constraint that contains the intersection of this constraint with the specified constraint, or null if there is no intersection. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ServerMinPrincipal(java.security.Principal p)
p
- the principalNullPointerException
- if the parameter is null
java.lang.IllegalArgumentException
- if the parameter is not an instance
of a trusted principal classpublic ServerMinPrincipal(java.security.Principal[] principals)
principals
- the principalsNullPointerException
- if the parameter is null
or
any element is null
java.lang.IllegalArgumentException
- if the parameter is empty or the
elements are not all instances of trusted principal classespublic ServerMinPrincipal(java.util.Collection c)
c
- the principalsNullPointerException
- if the parameter is null
or
any element is null
java.lang.IllegalArgumentException
- if the parameter is empty or the
elements are not all instances of trusted principal classesMethod Detail |
public java.util.Set elements()
UnsupportedOperationException
being
thrown.public SecurityConstraint reduceBy(SecurityConstraint c)
null
if there is no intersection.
For any instances c1
and c2
of this class,
c1.reduceBy(c2)
returns a ServerMinPrincipal
constructed from the combined principals of both c1
and
c2
, with duplicate principals removed.
For any instance c
of this class,
c.reduceBy(ServerAuthentication.NO)
returns
ServerAuthentication.NO
.
For any instance c1
of this class and any
ConstraintAlternatives
instance c2
containing ServerMinPrincipal
instances,
c1.reduceBy(c2)
returns the result of calling
ConstraintAlternatives.create
with all of the
values returned by c1.reduceBy(c)
for each element
c
of c2
.
For any instance c1
of this class and any other constraint
instance c2
no previously mentioned,
c1.reduceBy(c2)
returns c1
.
reduceBy
in interface SecurityConstraint
java.rmi.constraint.SecurityConstraint
c
- a constraintnull
if
there is no intersectionpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |