org.metastatic.jessie.pki

Class X509CertificateImpl

Implemented Interfaces:
Serializable, GnuPKIExtension, X509Extension

public class X509CertificateImpl
extends X509Certificate
implements Serializable, GnuPKIExtension

An implementation of X.509 certificates.
Author:
Casey Marshall (rsdio@metastatic.org)

Constructor Summary

X509CertificateImpl(InputStream encoded)
Create a new X.509 certificate from the encoded data.

Method Summary

void
checkValidity()
void
checkValidity(Date date)
boolean
equals(Object other)
int
getBasicConstraints()
Set
getCriticalExtensionOIDs()
byte[]
getEncoded()
List
getExtendedKeyUsage()
Extension
getExtension(OID oid)
byte[]
getExtensionValue(String oid)
Collection
getExtensions()
Collection
getIssuerAlternativeNames()
Principal
getIssuerDN()
boolean[]
getIssuerUniqueID()
boolean[]
getKeyUsage()
Set
getNonCriticalExtensionOIDs()
Date
getNotAfter()
Date
getNotBefore()
PublicKey
getPublicKey()
BigInteger
getSerialNumber()
String
getSigAlgName()
String
getSigAlgOID()
byte[]
getSigAlgParams()
byte[]
getSignature()
Collection
getSubjectAlternativeNames()
Principal
getSubjectDN()
boolean[]
getSubjectUniqueID()
byte[]
getTBSCertificate()
int
getVersion()
boolean
hasUnsupportedCriticalExtension()
String
toString()
void
verify(PublicKey key)
void
verify(PublicKey key, String provider)

Constructor Details

X509CertificateImpl

public X509CertificateImpl(InputStream encoded)
            throws CertificateException,
                   IOException
Create a new X.509 certificate from the encoded data. The input data are expected to be the ASN.1 DER encoding of the certificate.
Parameters:
encoded - The encoded certificate data.

Method Details

checkValidity

public void checkValidity()
            throws CertificateExpiredException,
                   CertificateNotYetValidException

checkValidity

public void checkValidity(Date date)
            throws CertificateExpiredException,
                   CertificateNotYetValidException

equals

public boolean equals(Object other)

getBasicConstraints

public int getBasicConstraints()

getCriticalExtensionOIDs

public Set getCriticalExtensionOIDs()

getEncoded

public byte[] getEncoded()
            throws CertificateEncodingException

getExtendedKeyUsage

public List getExtendedKeyUsage()
            throws CertificateParsingException

getExtension

public Extension getExtension(OID oid)
Specified by:
getExtension in interface GnuPKIExtension

getExtensionValue

public byte[] getExtensionValue(String oid)

getExtensions

public Collection getExtensions()
Specified by:
getExtensions in interface GnuPKIExtension

getIssuerAlternativeNames

public Collection getIssuerAlternativeNames()
            throws CertificateParsingException

getIssuerDN

public Principal getIssuerDN()

getIssuerUniqueID

public boolean[] getIssuerUniqueID()

getKeyUsage

public boolean[] getKeyUsage()

getNonCriticalExtensionOIDs

public Set getNonCriticalExtensionOIDs()

getNotAfter

public Date getNotAfter()

getNotBefore

public Date getNotBefore()

getPublicKey

public PublicKey getPublicKey()

getSerialNumber

public BigInteger getSerialNumber()

getSigAlgName

public String getSigAlgName()

getSigAlgOID

public String getSigAlgOID()

getSigAlgParams

public byte[] getSigAlgParams()

getSignature

public byte[] getSignature()

getSubjectAlternativeNames

public Collection getSubjectAlternativeNames()
            throws CertificateParsingException

getSubjectDN

public Principal getSubjectDN()

getSubjectUniqueID

public boolean[] getSubjectUniqueID()

getTBSCertificate

public byte[] getTBSCertificate()
            throws CertificateEncodingException

getVersion

public int getVersion()

hasUnsupportedCriticalExtension

public boolean hasUnsupportedCriticalExtension()

toString

public String toString()

verify

public void verify(PublicKey key)
            throws CertificateException,
                   NoSuchAlgorithmException,
                   InvalidKeyException,
                   NoSuchProviderException,
                   SignatureException

verify

public void verify(PublicKey key,
                   String provider)
            throws CertificateException,
                   NoSuchAlgorithmException,
                   InvalidKeyException,
                   NoSuchProviderException,
                   SignatureException