org.mozilla.jss.pkix.cert
Class Certificate
java.lang.Object
org.mozilla.jss.pkix.cert.Certificate
- ASN1Value
public class Certificate
extends java.lang.Object
An X.509 signed certificate.
Certificate
public Certificate(CertificateInfo info,
java.security.PrivateKey privKey,
SignatureAlgorithm signingAlg)
throws IOException,
CryptoManager.NotInitializedException,
TokenException,
NoSuchAlgorithmException,
CertificateException,
InvalidKeyException,
SignatureException
Creates and signs an X.509 Certificate.
info
- A CertificateInfo (TBSCertificate), which specifies
the actual information of the certificate.privKey
- The private key with which to sign the certificat.signingAlg
- The algorithm to use to sign the certificate.
It must match the algorithm specified in the CertificateInfo.
encode
public void encode(OutputStream ostream)
throws IOException
- encode in interface ASN1Value
encode
public void encode(Tag implicitTag,
OutputStream ostream)
throws IOException
- encode in interface ASN1Value
getInfo
public CertificateInfo getInfo()
Returns the information (TBSCertificate) contained in this certificate.
main
public static void main(argv[] )
verify
public void verify(PublicKey key)
throws InvalidKeyException,
NoSuchAlgorithmException,
CertificateException,
SignatureException
Verifies the signature on this certificate, using the given public key.
Does not indicate the certificate is valid at any specific time.
verify
public void verify(PublicKey key,
CryptoToken token)
throws NoSuchAlgorithmException,
CertificateException,
SignatureException,
InvalidKeyException
Verifies the signature on this certificate, using the given public
key and CryptoToken. Does not indicate the certificate is valid at
any specific time.