|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.Policy | +--net.drijf.javaone.DelegatingPolicy
This class implements an authorization policy that enables granting of
authorizition based on the CA of the associated certificates and based on
Role
s.
Role
Constructor Summary | |
DelegatingPolicy(java.io.File keystorePath,
char[] password,
RoleMapping roledefs)
Construct a new DelegatingPolicy . |
Method Summary | |
static void |
addPermissions(java.security.PermissionCollection set1,
java.security.PermissionCollection set2)
Add permissions to a permission collection. |
java.security.PermissionCollection |
getPermissions(java.security.cert.Certificate[] certs)
Return a permission collection associated with a list of certificates. |
java.security.PermissionCollection |
getPermissions(java.security.CodeSource cs)
Get the permission collection associated with a code source. |
java.security.PermissionCollection |
getPermissions(java.lang.String alias)
Return the permissions associated with a role. |
void |
refresh()
Refreshes the policy definition. |
static java.util.List |
splitCertificateArray(java.security.cert.Certificate[] certs)
Split up a certificate array returned by CodeSource.getCertficates into seperate chains. |
java.lang.String |
verifyChain(java.util.List chain)
Do a quite strict verification of a chain of certificates. |
Methods inherited from class java.security.Policy |
getPolicy, setPolicy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DelegatingPolicy(java.io.File keystorePath, char[] password, RoleMapping roledefs)
DelegatingPolicy
. Read the list of known
certificates from a keystore.keystorePath
- the path of the file containing the keystore.password
- the password associated with the keystore.roledefs
- the map mapping role names to Role
s.Method Detail |
public void refresh()
refresh
in class java.security.Policy
public java.security.PermissionCollection getPermissions(java.security.CodeSource cs)
getPermissions
in class java.security.Policy
cs
- the code source to return the permissions of.public java.security.PermissionCollection getPermissions(java.security.cert.Certificate[] certs)
certs
- an array of certificates. These certificates should be
X509 certificates.X509Certificate
public java.security.PermissionCollection getPermissions(java.lang.String alias)
alias
- the name of the role.null
.public static void addPermissions(java.security.PermissionCollection set1, java.security.PermissionCollection set2)
set1
- the collection to add to.set2
- the permissions to be added.public static java.util.List splitCertificateArray(java.security.cert.Certificate[] certs)
certs
- the array of certificates.public java.lang.String verifyChain(java.util.List chain) throws java.security.GeneralSecurityException
chain
- the certificate chain to verify.null
if no alias was found in the keystore.java.security.GeneralSecurityException
- if the chain fails verification
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |