org.mozilla.jss.pkix.cert
public class Certificate extends Object implements ASN1Value
Nested Class Summary | |
---|---|
static class | Certificate.Template |
Constructor Summary | |
---|---|
Certificate(CertificateInfo info, PrivateKey privKey, SignatureAlgorithm signingAlg)
Creates and signs an X.509 Certificate. |
Method Summary | |
---|---|
void | encode(OutputStream ostream) |
void | encode(Tag implicitTag, OutputStream ostream) |
CertificateInfo | getInfo()
Returns the information (TBSCertificate) contained in this certificate. |
Tag | getTag() |
static Certificate.Template | getTemplate() |
static void | main(String[] argv) |
void | verify()
Verifies the signature on this certificate. |
void | verify(PublicKey key)
Verifies the signature on this certificate, using the given public key.
|
void | verify(PublicKey key, CryptoToken token)
Verifies the signature on this certificate, using the given public
key and CryptoToken. |
Parameters: 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.
Throws: IOException If an error occurred while encoding the certificate. CryptoManager.NotInitializedException Because this operation involves cryptography (signing), CryptoManager must be initialized before calling it. TokenException If an error occurs on a PKCS #11 token. NoSuchAlgorithmException If the OID for the signing algorithm cannot be located. CertificateException If the signing algorithm specified as a parameter does not match the one in the certificate info. InvalidKeyException If the key does not match the signing algorithm. SignatureException If an error occurs while signing the certificate.