public class JSSEX509Wrapper
extends javax.security.cert.X509Certificate
javax.security.cert.X509Certificate class.
X509Certificate| Constructor and Description |
|---|
JSSEX509Wrapper(byte[] byteArray)
Creates an instance of the
JSSEX509Wrapper class. |
JSSEX509Wrapper(java.io.InputStream is)
Creates an instance of the
JSSEX509Wrapper class. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkValidity()
Checks the validity of the certificate at the current time.
|
void |
checkValidity(java.util.Date date)
Checks the validity of the certificate at the given time.
|
byte[] |
getEncoded()
Retrieves this X509 certificate as a DER encoded ASN.1 data
structure.
|
java.security.Principal |
getIssuerDN()
Retieves the distinguished name of the issuer of this certificate.
|
java.util.Date |
getNotAfter()
Retrieves the
notAfter date of this certificate. |
java.util.Date |
getNotBefore()
Retrieves the
notBefore date of this certificate. |
java.security.PublicKey |
getPublicKey()
Retieves the public key of this certificate.
|
java.math.BigInteger |
getSerialNumber()
Retrieves the serial number of the certificate.
|
java.lang.String |
getSigAlgName()
Retrieves the name of the signature algorithm used by the issuer
for signing this certificate.
|
java.lang.String |
getSigAlgOID()
Retrieves the OID of the signature algorithm used by the issuer
for signing this certificate.
|
byte[] |
getSigAlgParams()
Retrieves the algorithm parameters associated with the signature
algorithm used by the issuer for signing this certificate.
|
java.security.Principal |
getSubjectDN()
Retrieves the distinguished name of the subject of this
certificate, as a
Principal object. |
int |
getVersion()
Retrieves the version number of this certificate as an integer.
|
java.lang.String |
toString()
Returns a
String representing the contents of the
certificate. |
void |
verify(java.security.PublicKey key)
This method does nothing.
|
void |
verify(java.security.PublicKey key,
java.lang.String sigImpl)
This method does nothing.
|
public JSSEX509Wrapper(java.io.InputStream is)
throws javax.security.cert.CertificateException
JSSEX509Wrapper class.
is - the input stream from which the X.509 certificate is
read and createdjavax.security.cert.CertificateExceptionpublic JSSEX509Wrapper(byte[] byteArray)
throws javax.security.cert.CertificateException
JSSEX509Wrapper class.
byteArray - the PEM or DER byte array containing the X.509 certificate
to be createdjavax.security.cert.CertificateExceptionpublic void checkValidity()
throws javax.security.cert.CertificateExpiredException,
javax.security.cert.CertificateNotYetValidException
checkValidity in class javax.security.cert.X509Certificatejavax.security.cert.CertificateExpiredException - thrown if the certificate has expiredjavax.security.cert.CertificateNotYetValidException - thrown if the certificate is not yet validpublic void checkValidity(java.util.Date date)
throws javax.security.cert.CertificateExpiredException,
javax.security.cert.CertificateNotYetValidException
checkValidity in class javax.security.cert.X509Certificatejavax.security.cert.CertificateExpiredException - thrown if the certificate has expiredjavax.security.cert.CertificateNotYetValidException - thrown if the certificate is not yet validpublic java.security.Principal getIssuerDN()
getIssuerDN in class javax.security.cert.X509Certificatepublic java.util.Date getNotBefore()
notBefore date of this certificate.
getNotBefore in class javax.security.cert.X509Certificatenull if the notBefore date has
not yet been set in the certificate.public java.util.Date getNotAfter()
notAfter date of this certificate.
getNotAfter in class javax.security.cert.X509Certificatenull if the notAfter date has
not yet been set in the certificate.public java.math.BigInteger getSerialNumber()
getSerialNumber in class javax.security.cert.X509CertificateBigInteger.public java.lang.String getSigAlgName()
getSigAlgName in class javax.security.cert.X509Certificatemd5WithRSAEncryption, for example), or
null if the signature algorithm has not
yet been set.public java.lang.String getSigAlgOID()
getSigAlgOID in class javax.security.cert.X509CertificateString,
or null if the signature algorithm has not
yet been set.public byte[] getSigAlgParams()
The parameters are returned as a DER encoded ASN.1 data structure.
getSigAlgParams in class javax.security.cert.X509Certificatenull if there are no
parameters used or the signature algorithm has not yet
been set.public java.security.Principal getSubjectDN()
Principal object.
The subject of the certificate is the entity to which the certificate belongs.
getSubjectDN in class javax.security.cert.X509CertificatePrincipal object.public int getVersion()
The version number can specify a v1, v2,
or v3 certificate.
The ASN.1 definition of the certificate's version umber is:
Version ::= INTEGER { v1(0), v2(1), v3(2) }
getVersion in class javax.security.cert.X509Certificateint:
0 for a v1 cert1 for a v2 cert2 for a v3 certpublic byte[] getEncoded()
throws javax.security.cert.CertificateEncodingException
getEncoded in class javax.security.cert.Certificatebyte array holding the DER encoded
X509 certificate ASN.1 data structurejavax.security.cert.CertificateEncodingException - thrown if the certificate cannot be encoded correctlypublic java.security.PublicKey getPublicKey()
This is the public key that belongs to the subject of the certificate.
getPublicKey in class javax.security.cert.Certificatepublic java.lang.String toString()
String representing the contents of the
certificate.
toString in class javax.security.cert.CertificateString representation of this
certificate.public void verify(java.security.PublicKey key)
throws javax.security.cert.CertificateException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.NoSuchProviderException,
java.security.SignatureException
verify in class javax.security.cert.Certificatejavax.security.cert.CertificateExceptionjava.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.NoSuchProviderExceptionjava.security.SignatureExceptionpublic void verify(java.security.PublicKey key,
java.lang.String sigImpl)
throws javax.security.cert.CertificateException,
java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.NoSuchProviderException,
java.security.SignatureException
verify in class javax.security.cert.Certificatejavax.security.cert.CertificateExceptionjava.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.NoSuchProviderExceptionjava.security.SignatureException