org.openpermis.cert
Class AttributeCertificateExtractorUtility

java.lang.Object
  extended by org.openpermis.cert.AttributeCertificateExtractorUtility

public final class AttributeCertificateExtractorUtility
extends Object

Since:
0.3.0

Method Summary
static PolicyDecisionPoint createPolicyDecisionPoint(AttributeCertificate certificate, CertificateVerifier certificateVerifier)
          Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.
static PolicyDecisionPoint createPolicyDecisionPoint(byte[] policyCertificate, CertificateVerifier certificateVerifier)
          Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.
static PolicyDecisionPoint createPolicyDecisionPoint(URL policyCertificate, CertificateVerifier certificateVerifier)
          Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.
static X500Principal readHolder(AttributeCertificate certificate)
          Reads a holder from an AttributeCertificate.
static X500Principal readIssuer(AttributeCertificate certificate)
          Reads a issuer from an AttributeCertificate.
static String readPolicy(URL policyCertificate)
          Extracts the policy as a string from the specified attribute certificate.
static String readPolicyAttribute(AttributeCertificate certificate)
          Reads a policy from an AttributeCertificate.
static List<RoleDefinition> readRoleAttribute(AttributeCertificate certificate)
          Reads a List of roles from an AttributeCertificate.
static TimePeriod readValidityPeriod(AttributeCertificate certificate)
          Reads a TimePeriod from an AttributeCertificate.
static URI toUri(X500Principal principal)
           
static X500Principal toX500Principal(URI uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readValidityPeriod

public static TimePeriod readValidityPeriod(AttributeCertificate certificate)
Reads a TimePeriod from an AttributeCertificate.

Parameters:
certificate - an AttributeCertificate.
Returns:
a TimePeriod.
Since:
0.3.0

readHolder

public static X500Principal readHolder(AttributeCertificate certificate)
                                throws AttributeCertificateException
Reads a holder from an AttributeCertificate. Currently only the entityName syntax is supported. RFC 3281 allows three different (optional) holder syntaxes: baseCertificateID, entityName and objectDigestInfo. The meaning is clear if exactly one holder is defined and it is not clear if more than one are defined. Therefore FRC 3281 recommends to use only one.

Parameters:
certificate - an AttributeCertificate.
Returns:
an X500Principal.
Throws:
AttributeCertificateException - indicates an holder reading problem.
Since:
0.3.0

readIssuer

public static X500Principal readIssuer(AttributeCertificate certificate)
                                throws AttributeCertificateException
Reads a issuer from an AttributeCertificate. RFC 3281 defines that exactly one general name must be specified.

Parameters:
certificate - an AttributeCertificate.
Returns:
an X500Principal.
Throws:
AttributeCertificateException - indicates an issuer reading problem.
Since:
0.3.0

readPolicyAttribute

public static String readPolicyAttribute(AttributeCertificate certificate)
                                  throws AttributeCertificateException
Reads a policy from an AttributeCertificate.

Parameters:
certificate - an AttributeCertificate.
Returns:
the policy String.
Throws:
AttributeCertificateException - indicates a reading problem.
Since:
0.3.0

readRoleAttribute

public static List<RoleDefinition> readRoleAttribute(AttributeCertificate certificate)
                                              throws AttributeCertificateException
Reads a List of roles from an AttributeCertificate.

Parameters:
certificate - an AttributeCertificate.
Returns:
the role List.
Throws:
AttributeCertificateException - indicates a reading problem.
Since:
0.3.0

createPolicyDecisionPoint

public static PolicyDecisionPoint createPolicyDecisionPoint(byte[] policyCertificate,
                                                            CertificateVerifier certificateVerifier)
                                                     throws org.bouncycastle.util.StreamParsingException,
                                                            IOException,
                                                            CertificateException,
                                                            PolicyException,
                                                            AttributeCertificateException
Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.

Parameters:
policyCertificate - Byte array containing the attribute certificate containing the policy.
certificateVerifier - The certificate verifier used to verify the attribute certificate containing the policy.
Returns:
Returns the policy object.
Throws:
org.bouncycastle.util.StreamParsingException - Thrown if an attribute certificate cannot be parsed.
IOException - Thrown if the attribute certificate cannot be read.
CertificateException - Thrown if a certificate cannot be verified.
PolicyException - Thrown if the policy cannot be parsed.
AttributeCertificateException - if the policy cannot be parsed.
Since:
0.9.0

createPolicyDecisionPoint

public static PolicyDecisionPoint createPolicyDecisionPoint(URL policyCertificate,
                                                            CertificateVerifier certificateVerifier)
                                                     throws org.bouncycastle.util.StreamParsingException,
                                                            IOException,
                                                            CertificateException,
                                                            PolicyException,
                                                            AttributeCertificateException
Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.

Parameters:
policyCertificate - The URL of the attribute certificate containing the policy.
certificateVerifier - The certificate verifier used to verify the attribute certificate containing the policy.
Returns:
Returns the policy object.
Throws:
org.bouncycastle.util.StreamParsingException - Thrown if an attribute certificate cannot be parsed.
IOException - Thrown if the attribute certificate cannot be read.
CertificateException - Thrown if a certificate cannot be verified.
PolicyException - Thrown if the policy cannot be parsed.
AttributeCertificateException - if the policy cannot be parsed.
Since:
0.3.0

createPolicyDecisionPoint

public static PolicyDecisionPoint createPolicyDecisionPoint(AttributeCertificate certificate,
                                                            CertificateVerifier certificateVerifier)
                                                     throws org.bouncycastle.util.StreamParsingException,
                                                            IOException,
                                                            CertificateException,
                                                            PolicyException,
                                                            AttributeCertificateException
Creates a policy decision point from the specified attribute certificate and verifies it with the specified certificate verifier.

Parameters:
certificate - The attribute certificate containing the policy.
certificateVerifier - The certificate verifier used to verify the attribute certificate containing the policy.
Returns:
Returns the policy object.
Throws:
org.bouncycastle.util.StreamParsingException - Thrown if an attribute certificate cannot be parsed.
IOException - Thrown if the attribute certificate cannot be read.
CertificateException - Thrown if a certificate cannot be verified.
PolicyException - Thrown if the policy cannot be parsed.
AttributeCertificateException - if the policy cannot be parsed.
Since:
0.9.0

readPolicy

public static String readPolicy(URL policyCertificate)
                         throws IOException,
                                AttributeCertificateException
Extracts the policy as a string from the specified attribute certificate.

Parameters:
policyCertificate - The URL of the attribute certificate containing the policy.
Returns:
Returns the policy as a string.
Throws:
IOException - Thrown if the attribute certificate cannot be read.
AttributeCertificateException - if the policy cannot be parsed.
Since:
0.3.0

toX500Principal

public static X500Principal toX500Principal(URI uri)
Since:
0.3.0

toUri

public static URI toUri(X500Principal principal)
Since:
0.3.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:16:59
Copyright (c) 2002-2007 Ergon Informatik AG