anon.crypto
Class X509Extensions

java.lang.Object
  extended by anon.crypto.X509Extensions

public final class X509Extensions
extends java.lang.Object

Stores X509 extensions as described in RFC 3280.

Author:
Rolf Wendolsky
See Also:
http://www.faqs.org/rfcs/rfc3280.html

Field Summary
private static java.util.Vector KNOWN_CERTIFICATE_EXTENSIONS
           
private static java.util.Vector KNOWN_CRL_ENTRY_EXTENSIONS
           
private static java.util.Vector KNOWN_CRL_EXTENSIONS
           
private  org.bouncycastle.asn1.DERSet m_extensions
           
private  java.util.Vector m_vecExtensions
           
private  org.bouncycastle.asn1.DERObjectIdentifier X509_EXTENSIONS_IDENTIFIER
           
 
Constructor Summary
X509Extensions(AbstractX509Extension a_extension)
          Creates a new X509Extensions object from a single extension.
X509Extensions(org.bouncycastle.asn1.DERSet a_extensions)
          Creates an X509Extensions object from a DERTaggedObject.
X509Extensions(java.util.Vector a_extensions)
          Creates a new X509Extensions object that holds all extensions in the given Vector.
X509Extensions(org.bouncycastle.asn1.x509.X509Extensions a_extensions)
          Creates an X509Extensions object from a BouncyCastle X509Extensions object.
 
Method Summary
private static java.util.Vector createExtensionsFromX509Extensions(org.bouncycastle.asn1.x509.X509Extensions a_extensions)
           
(package private)  org.bouncycastle.asn1.DERSet getBCExtensions()
          Returns the object as BouncyCastle DERSet.
(package private)  org.bouncycastle.asn1.x509.X509Extensions getBCX509Extensions()
          Returns the object a BouncyCastle X509Extensions object.
 AbstractX509Extension getExtension(int a_index)
          Returns the extension at the given index.
 AbstractX509Extension getExtension(java.lang.String a_identifier)
          Returns the extension with the specified identifier if it is contained in this X509Extensions object.
 java.util.Vector getExtensions()
          Returns a Vector with all X509 extensions that are contained in this object as AbstractX509Extension objects.
 java.util.Vector getExtensions(java.lang.String a_identifier)
          Returns the extensions with the specified identifier if they are contained in this X509Extensions object.
 int getSize()
          Returns the number of extensions contained in this object.
protected  boolean hasUnknownCriticalExtensions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X509_EXTENSIONS_IDENTIFIER

private org.bouncycastle.asn1.DERObjectIdentifier X509_EXTENSIONS_IDENTIFIER

KNOWN_CERTIFICATE_EXTENSIONS

private static final java.util.Vector KNOWN_CERTIFICATE_EXTENSIONS

KNOWN_CRL_EXTENSIONS

private static final java.util.Vector KNOWN_CRL_EXTENSIONS

KNOWN_CRL_ENTRY_EXTENSIONS

private static final java.util.Vector KNOWN_CRL_ENTRY_EXTENSIONS

m_extensions

private org.bouncycastle.asn1.DERSet m_extensions

m_vecExtensions

private java.util.Vector m_vecExtensions
Constructor Detail

X509Extensions

public X509Extensions(AbstractX509Extension a_extension)
Creates a new X509Extensions object from a single extension.

Parameters:
a_extension - an AbstractX509Extension

X509Extensions

public X509Extensions(java.util.Vector a_extensions)
Creates a new X509Extensions object that holds all extensions in the given Vector. The extensions must be of the type AbstractX509Extension.

Parameters:
a_extensions - a Vector with extension of the type AbstractX509Extension

X509Extensions

X509Extensions(org.bouncycastle.asn1.DERSet a_extensions)
Creates an X509Extensions object from a DERTaggedObject. For internal use only.

Parameters:
a_extensions - a DERTaggedObject containing X509 extensions

X509Extensions

X509Extensions(org.bouncycastle.asn1.x509.X509Extensions a_extensions)
Creates an X509Extensions object from a BouncyCastle X509Extensions object. For internal use only.

Parameters:
a_extensions - a BouncyCastle X509Extensions object
Method Detail

getSize

public int getSize()
Returns the number of extensions contained in this object.

Returns:
the number of extensions contained in this object

getExtension

public AbstractX509Extension getExtension(int a_index)
Returns the extension at the given index.

Parameters:
a_index - an index number
Returns:
AbstractX509Extension the extension at the given index
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this X509Extensions object

getExtension

public AbstractX509Extension getExtension(java.lang.String a_identifier)
Returns the extension with the specified identifier if it is contained in this X509Extensions object.

Parameters:
a_identifier - an X509 extension identifier
Returns:
the extension with the specified identifier or null if it is not contained in this X509Extensions object

getExtensions

public java.util.Vector getExtensions(java.lang.String a_identifier)
Returns the extensions with the specified identifier if they are contained in this X509Extensions object.

Parameters:
a_identifier - an X509 extension identifier
Returns:
the extensions with the specified identifier or an empty Vector if it is not contained in this X509Extensions object

getExtensions

public java.util.Vector getExtensions()
Returns a Vector with all X509 extensions that are contained in this object as AbstractX509Extension objects.

Returns:
a Vector with all X509 extensions that are contained in this object as AbstractX509Extension objects

getBCExtensions

org.bouncycastle.asn1.DERSet getBCExtensions()
Returns the object as BouncyCastle DERSet. For internal use only.

Returns:
the object as BouncyCastle DERSet

getBCX509Extensions

org.bouncycastle.asn1.x509.X509Extensions getBCX509Extensions()
Returns the object a BouncyCastle X509Extensions object.

Returns:
the object a BouncyCastle X509Extensions object

createExtensionsFromX509Extensions

private static java.util.Vector createExtensionsFromX509Extensions(org.bouncycastle.asn1.x509.X509Extensions a_extensions)

hasUnknownCriticalExtensions

protected boolean hasUnknownCriticalExtensions()