public class X509Cert extends java.lang.Object implements Certificate
The interface here does not match Sun's certificate interface, and even though that interface is pretty useless, we should still probably implement it.
| Constructor and Description |
|---|
X509Cert(byte[] ber_)
Create an X509Cert from an encoded value
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getDER()
Get the encoded form of this certificate
|
java.util.Vector |
getExtensions()
Get the vector of extensions (if any)
|
byte[] |
getIssuerDER()
Get the encoded form of the issuerName
|
DistinguishedName |
getIssuerName()
Get the issuer name as an X509Name
|
java.security.PublicKey |
getPublicKey()
Get the publicKey associated with this certificate
|
java.math.BigInteger |
getSerial()
Get the serial number
|
byte[] |
getSubjectDER()
Get the encoded form of the subjectName
|
DistinguishedName |
getSubjectName()
Get the subject name as an X509Name
|
java.util.Date |
getValidityNotAfter()
Get the end of the validity window
|
java.util.Date |
getValidityNotBefore()
Get the beginning of the validity window
|
boolean |
verify(java.security.PublicKey key)
Check a certificate signature using the specified public key
|
static java.util.Vector |
verifyCertChain(CertContext ctx,
java.util.Vector certs,
CertVerifyPolicyInt policy)
Verify a certificate chain.
|
public X509Cert(byte[] ber_)
throws CertificateException
ber_ - the encoded certificate as a byte[]
Currently this chokes if the cert is poorly encoded. We have to fix that to throw an IOException. TODO
CertificateExceptionpublic java.security.PublicKey getPublicKey()
public byte[] getDER()
getDER in interface Certificatepublic byte[] getIssuerDER()
getIssuerDER in interface Certificatepublic byte[] getSubjectDER()
getSubjectDER in interface Certificatepublic DistinguishedName getSubjectName()
getSubjectName in interface Certificatepublic DistinguishedName getIssuerName()
getIssuerName in interface Certificatepublic java.util.Date getValidityNotBefore()
getValidityNotBefore in interface Certificatepublic java.util.Date getValidityNotAfter()
getValidityNotAfter in interface Certificatepublic java.util.Vector getExtensions()
CertificategetExtensions in interface Certificatepublic java.math.BigInteger getSerial()
getSerial in interface Certificatepublic boolean verify(java.security.PublicKey key)
throws CertificateException
CertificateExceptionpublic static java.util.Vector verifyCertChain(CertContext ctx, java.util.Vector certs, CertVerifyPolicyInt policy) throws CertificateException
ctx - the cert contextcerts - the certs to start with, ordered root firstCertificateExceptionCopyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.