gnu.crypto.pki

Class X509CertificateImpl

Implemented Interfaces:
Serializable, GnuPKIExtension, X509Extension
Known Direct Subclasses:
X509CertificateBuilder

public class X509CertificateImpl
extends X509Certificate
implements Serializable, GnuPKIExtension

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

Field Summary

protected static OID
ID_DSA
protected static OID
ID_DSA_WITH_SHA1
protected static OID
ID_ECDSA_WITH_SHA1
protected static OID
ID_RSA
protected static OID
ID_RSA_WITH_MD2
protected static OID
ID_RSA_WITH_MD5
protected static OID
ID_RSA_WITH_SHA1
protected OID
algId
protected byte[]
algVal
protected byte[]
encoded
protected Map
extensions
protected X500Name
issuer
protected BitString
issuerUniqueId
protected Date
notAfter
protected Date
notBefore
protected BigInteger
serialNo
protected OID
sigAlgId
protected byte[]
sigAlgVal
protected byte[]
signature
protected X500Name
subject
protected PublicKey
subjectKey
protected BitString
subjectUniqueId
protected byte[]
tbsCertBytes
protected int
version

Constructor Summary

X509CertificateImpl()
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)
Returns the extension object for the given object identifier.
byte[]
getExtensionValue(String oid)
Collection
getExtensions()
Collection
getIssuerAlternativeNames()
Principal
getIssuerDN()
boolean[]
getIssuerUniqueID()
X500Principal
getIssuerX500Principal()
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()
X500Principal
getSubjectX500Principal()
byte[]
getTBSCertificate()
int
getVersion()
boolean
hasUnsupportedCriticalExtension()
String
toString()
void
verify(PublicKey key)
void
verify(PublicKey key, String provider)

Field Details

ID_DSA

protected static final OID ID_DSA

ID_DSA_WITH_SHA1

protected static final OID ID_DSA_WITH_SHA1

ID_ECDSA_WITH_SHA1

protected static final OID ID_ECDSA_WITH_SHA1

ID_RSA

protected static final OID ID_RSA

ID_RSA_WITH_MD2

protected static final OID ID_RSA_WITH_MD2

ID_RSA_WITH_MD5

protected static final OID ID_RSA_WITH_MD5

ID_RSA_WITH_SHA1

protected static final OID ID_RSA_WITH_SHA1

algId

protected OID algId

algVal

protected byte[] algVal

encoded

protected byte[] encoded

extensions

protected Map extensions

issuer

protected X500Name issuer

issuerUniqueId

protected BitString issuerUniqueId

notAfter

protected Date notAfter

notBefore

protected Date notBefore

serialNo

protected BigInteger serialNo

sigAlgId

protected OID sigAlgId

sigAlgVal

protected byte[] sigAlgVal

signature

protected byte[] signature

subject

protected X500Name subject

subjectKey

protected PublicKey subjectKey

subjectUniqueId

protected BitString subjectUniqueId

tbsCertBytes

protected byte[] tbsCertBytes

version

protected int version

Constructor Details

X509CertificateImpl

protected X509CertificateImpl()

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)
Returns the extension object for the given object identifier.
Specified by:
getExtension in interface GnuPKIExtension
Parameters:
oid - The OID of the extension to get.
Returns:
The extension, or null if there is no such extension.

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()

getIssuerX500Principal

public X500Principal getIssuerX500Principal()

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()

getSubjectX500Principal

public X500Principal getSubjectX500Principal()

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

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.