Package org.gudy.bouncycastle.x509
Class X509V2AttributeCertificate
java.lang.Object
org.gudy.bouncycastle.x509.X509V2AttributeCertificate
- All Implemented Interfaces:
X509Extension
,X509AttributeCertificate
An implementation of a version 2 X.509 Attribute Certificate.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
checkValidity
(Date date) boolean
Return the attributes contained in the attribute block in the certificate.getAttributes
(String oid) Return the attributes with the same type as the passed in oid.byte[]
Return an ASN.1 encoded byte array representing the attribute certificate.private Set
getExtensionOIDs
(boolean critical) byte[]
getExtensionValue
(String oid) Return the holder of the certificate.Return the issuer details for the certificate.boolean[]
Return the date after which the certificate is not valid.Return the date before which the certificate is not valid.Return the serial number for the certificate.byte[]
int
Return the version number for the certificate.int
hashCode()
boolean
final void
-
Field Details
-
cert
-
notBefore
-
notAfter
-
-
Constructor Details
-
X509V2AttributeCertificate
- Throws:
IOException
-
X509V2AttributeCertificate
- Throws:
IOException
-
X509V2AttributeCertificate
X509V2AttributeCertificate(AttributeCertificate cert) throws IOException - Throws:
IOException
-
-
Method Details
-
getVersion
public int getVersion()Description copied from interface:X509AttributeCertificate
Return the version number for the certificate.- Specified by:
getVersion
in interfaceX509AttributeCertificate
- Returns:
- the version number.
-
getSerialNumber
Description copied from interface:X509AttributeCertificate
Return the serial number for the certificate.- Specified by:
getSerialNumber
in interfaceX509AttributeCertificate
- Returns:
- the serial number.
-
getHolder
Description copied from interface:X509AttributeCertificate
Return the holder of the certificate.- Specified by:
getHolder
in interfaceX509AttributeCertificate
- Returns:
- the holder.
-
getIssuer
Description copied from interface:X509AttributeCertificate
Return the issuer details for the certificate.- Specified by:
getIssuer
in interfaceX509AttributeCertificate
- Returns:
- the issuer details.
-
getNotBefore
Description copied from interface:X509AttributeCertificate
Return the date before which the certificate is not valid.- Specified by:
getNotBefore
in interfaceX509AttributeCertificate
- Returns:
- the "not valid before" date.
-
getNotAfter
Description copied from interface:X509AttributeCertificate
Return the date after which the certificate is not valid.- Specified by:
getNotAfter
in interfaceX509AttributeCertificate
- Returns:
- the "not valid afer" date.
-
getIssuerUniqueID
public boolean[] getIssuerUniqueID()- Specified by:
getIssuerUniqueID
in interfaceX509AttributeCertificate
-
checkValidity
- Specified by:
checkValidity
in interfaceX509AttributeCertificate
- Throws:
CertificateExpiredException
CertificateNotYetValidException
-
checkValidity
public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException - Specified by:
checkValidity
in interfaceX509AttributeCertificate
- Throws:
CertificateExpiredException
CertificateNotYetValidException
-
getSignature
public byte[] getSignature()- Specified by:
getSignature
in interfaceX509AttributeCertificate
-
verify
public final void verify(PublicKey key, String provider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException - Specified by:
verify
in interfaceX509AttributeCertificate
- Throws:
CertificateException
NoSuchAlgorithmException
InvalidKeyException
NoSuchProviderException
SignatureException
-
getEncoded
Description copied from interface:X509AttributeCertificate
Return an ASN.1 encoded byte array representing the attribute certificate.- Specified by:
getEncoded
in interfaceX509AttributeCertificate
- Returns:
- an ASN.1 encoded byte array.
- Throws:
IOException
- if the certificate cannot be encoded.
-
getExtensionValue
- Specified by:
getExtensionValue
in interfaceX509Extension
-
getExtensionOIDs
-
getNonCriticalExtensionOIDs
- Specified by:
getNonCriticalExtensionOIDs
in interfaceX509Extension
-
getCriticalExtensionOIDs
- Specified by:
getCriticalExtensionOIDs
in interfaceX509Extension
-
hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()- Specified by:
hasUnsupportedCriticalExtension
in interfaceX509Extension
-
getAttributes
Description copied from interface:X509AttributeCertificate
Return the attributes contained in the attribute block in the certificate.- Specified by:
getAttributes
in interfaceX509AttributeCertificate
- Returns:
- an array of attributes.
-
getAttributes
Description copied from interface:X509AttributeCertificate
Return the attributes with the same type as the passed in oid.- Specified by:
getAttributes
in interfaceX509AttributeCertificate
- Parameters:
oid
- the object identifier we wish to match.- Returns:
- an array of matched attributes, null if there is no match.
-
equals
-
hashCode
public int hashCode()
-