eu.emi.security.authn.x509.helpers.proxy
Class ProxyCertInfoExtension

java.lang.Object
  extended by org.bouncycastle.asn1.ASN1Encodable
      extended by eu.emi.security.authn.x509.helpers.proxy.ProxyCertInfoExtension
All Implemented Interfaces:
DEREncodable

public class ProxyCertInfoExtension
extends ASN1Encodable

Proxy cert info extension class.

 ProxyCertInfoExtension ::= SEQUENCE { 
          pCPathLenConstraint    ProxyCertPathLengthConstraint OPTIONAL, 
          proxyPolicy            ProxyPolicy }
  
     ProxyCertPathLengthConstraint ::= INTEGER
 

Author:
Joni Hahkala, K. Benedyczak

Field Summary
static String DRAFT_EXTENSION_OID
          The oid of the rfc draft proxy cert extension.
static String RFC_EXTENSION_OID
          The oid of the proxy cert info extension, defined in the RFC 3820.
 
Fields inherited from class org.bouncycastle.asn1.ASN1Encodable
BER, DER
 
Constructor Summary
ProxyCertInfoExtension()
          Generate a proxy that inherits all rights and that has no cert path length limitations.
ProxyCertInfoExtension(ASN1Sequence seq)
          Read a proxyCertInfoExtension from the ASN1 sequence.
ProxyCertInfoExtension(byte[] bytes)
          Constructor that generates instance out of byte array.
ProxyCertInfoExtension(int pathLen, ProxyPolicy policy)
          Generate new proxy certificate info extension with length limit len and policy policy.
 
Method Summary
static ProxyCertInfoExtension getInstance(X509Certificate cert)
          Tries to generate ProxyCertInfoExtension object from the provided certificate.
 ProxyPolicy getPolicy()
          Get the policy object of this extension.
 int getProxyPathLimit()
          Get the proxy certificate path length limit of this extension, if set.
 DERObject toASN1Object()
           
 
Methods inherited from class org.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RFC_EXTENSION_OID

public static final String RFC_EXTENSION_OID
The oid of the proxy cert info extension, defined in the RFC 3820.

See Also:
Constant Field Values

DRAFT_EXTENSION_OID

public static final String DRAFT_EXTENSION_OID
The oid of the rfc draft proxy cert extension.

See Also:
Constant Field Values
Constructor Detail

ProxyCertInfoExtension

public ProxyCertInfoExtension(int pathLen,
                              ProxyPolicy policy)
Generate new proxy certificate info extension with length limit len and policy policy. Use negative value if no limit is desired.

Parameters:
pathLen - the maximum number of proxy certificates to follow this one. If Integer.MAX_VALUE is used then no limit will be set.
policy - the proxy policy extension.

ProxyCertInfoExtension

public ProxyCertInfoExtension()
Generate a proxy that inherits all rights and that has no cert path length limitations.


ProxyCertInfoExtension

public ProxyCertInfoExtension(byte[] bytes)
                       throws IOException
Constructor that generates instance out of byte array.

Parameters:
bytes - The byte array to consider as the ASN.1 encoded proxyCertInfo extension.
Throws:
IOException - thrown in case the parsing of the byte array fails.

ProxyCertInfoExtension

public ProxyCertInfoExtension(ASN1Sequence seq)
                       throws IOException
Read a proxyCertInfoExtension from the ASN1 sequence.

Parameters:
seq - The sequence containing the extension.
Throws:
IOException
Method Detail

getInstance

public static ProxyCertInfoExtension getInstance(X509Certificate cert)
                                          throws IOException
Tries to generate ProxyCertInfoExtension object from the provided certificate. Returns null if the certificate has no proxy extension (draft or rfc).

Parameters:
cert -
Returns:
instance intialized from the certificate object
Throws:
IOException

getProxyPathLimit

public int getProxyPathLimit()
Get the proxy certificate path length limit of this extension, if set.

Returns:
The number of allowed proxy certificates in the chain allowed after this certificate. Integer.MAX_VALUE if not set.

getPolicy

public ProxyPolicy getPolicy()
Get the policy object of this extension.

Returns:
The ProxyPolicy object.

toASN1Object

public DERObject toASN1Object()
Specified by:
toASN1Object in class ASN1Encodable


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.