org.bouncycastle.x509

Class X509V2AttributeCertificate

Implemented Interfaces:
X509AttributeCertificate, X509Extension

public class X509V2AttributeCertificate
extends java.lang.Object
implements X509AttributeCertificate

An implementation of a version 2 X.509 Attribute Certificate.

Constructor Summary

X509V2AttributeCertificate(InputStream encIn)
X509V2AttributeCertificate(byte[] encoded)

Method Summary

void
checkValidity()
void
checkValidity(Date date)
boolean
equals(Object o)
X509Attribute[]
getAttributes()
Return the attributes contained in the attribute block in the certificate.
X509Attribute[]
getAttributes(String oid)
Return the attributes with the same type as the passed in oid.
Set
getCriticalExtensionOIDs()
byte[]
getEncoded()
Return an ASN.1 encoded byte array representing the attribute certificate.
byte[]
getExtensionValue(String oid)
AttributeCertificateHolder
getHolder()
Return the holder of the certificate.
AttributeCertificateIssuer
getIssuer()
Return the issuer details for the certificate.
boolean[]
getIssuerUniqueID()
Set
getNonCriticalExtensionOIDs()
Date
getNotAfter()
Return the date after which the certificate is not valid.
Date
getNotBefore()
Return the date before which the certificate is not valid.
BigInteger
getSerialNumber()
Return the serial number for the certificate.
byte[]
getSignature()
int
getVersion()
Return the version number for the certificate.
boolean
hasUnsupportedCriticalExtension()
int
hashCode()
void
verify(PublicKey key, String provider)

Constructor Details

X509V2AttributeCertificate

public X509V2AttributeCertificate(InputStream encIn)
            throws IOException

X509V2AttributeCertificate

public X509V2AttributeCertificate(byte[] encoded)
            throws IOException

Method Details

checkValidity

public void checkValidity()
            throws CertificateExpiredException,
                   CertificateNotYetValidException
Specified by:
checkValidity in interface X509AttributeCertificate

checkValidity

public void checkValidity(Date date)
            throws CertificateExpiredException,
                   CertificateNotYetValidException
Specified by:
checkValidity in interface X509AttributeCertificate

equals

public boolean equals(Object o)

getAttributes

public X509Attribute[] getAttributes()
Return the attributes contained in the attribute block in the certificate.
Specified by:
getAttributes in interface X509AttributeCertificate
Returns:
an array of attributes.

getAttributes

public X509Attribute[] getAttributes(String oid)
Return the attributes with the same type as the passed in oid.
Specified by:
getAttributes in interface X509AttributeCertificate
Parameters:
oid - the object identifier we wish to match.
Returns:
an array of matched attributes, null if there is no match.

getCriticalExtensionOIDs

public Set getCriticalExtensionOIDs()
Specified by:
getCriticalExtensionOIDs in interface X509AttributeCertificate

getEncoded

public byte[] getEncoded()
            throws IOException
Return an ASN.1 encoded byte array representing the attribute certificate.
Specified by:
getEncoded in interface X509AttributeCertificate
Returns:
an ASN.1 encoded byte array.

getExtensionValue

public byte[] getExtensionValue(String oid)

getHolder

public AttributeCertificateHolder getHolder()
Return the holder of the certificate.
Specified by:
getHolder in interface X509AttributeCertificate
Returns:
the holder.

getIssuer

public AttributeCertificateIssuer getIssuer()
Return the issuer details for the certificate.
Specified by:
getIssuer in interface X509AttributeCertificate
Returns:
the issuer details.

getIssuerUniqueID

public boolean[] getIssuerUniqueID()
Specified by:
getIssuerUniqueID in interface X509AttributeCertificate

getNonCriticalExtensionOIDs

public Set getNonCriticalExtensionOIDs()
Specified by:
getNonCriticalExtensionOIDs in interface X509AttributeCertificate

getNotAfter

public Date getNotAfter()
Return the date after which the certificate is not valid.
Specified by:
getNotAfter in interface X509AttributeCertificate
Returns:
the "not valid afer" date.

getNotBefore

public Date getNotBefore()
Return the date before which the certificate is not valid.
Specified by:
getNotBefore in interface X509AttributeCertificate
Returns:
the "not valid before" date.

getSerialNumber

public BigInteger getSerialNumber()
Return the serial number for the certificate.
Specified by:
getSerialNumber in interface X509AttributeCertificate
Returns:
the serial number.

getSignature

public byte[] getSignature()
Specified by:
getSignature in interface X509AttributeCertificate

getVersion

public int getVersion()
Return the version number for the certificate.
Specified by:
getVersion in interface X509AttributeCertificate
Returns:
the version number.

hasUnsupportedCriticalExtension

public boolean hasUnsupportedCriticalExtension()

hashCode

public int hashCode()

verify

public final void verify(PublicKey key,
                         String provider)
            throws CertificateException,
                   NoSuchAlgorithmException,
                   InvalidKeyException,
                   NoSuchProviderException,
                   SignatureException
Specified by:
verify in interface X509AttributeCertificate