org.mozilla.jss.pkcs10

Class CertificationRequest

public class CertificationRequest extends Object implements ASN1Value

A pkcs10 signed CertificationRequest.
Nested Class Summary
static classCertificationRequest.Template
Constructor Summary
CertificationRequest(CertificationRequestInfo info, PrivateKey privKey, SignatureAlgorithm signingAlg)
Creates and signs an X.509 CertificationRequest.
Method Summary
voidencode(OutputStream ostream)
voidencode(Tag implicitTag, OutputStream ostream)
CertificationRequestInfogetInfo()
Returns the information (TBSCertificationRequest) contained in this CertificationRequest.
TaggetTag()
static CertificationRequest.TemplategetTemplate()
static voidmain(String[] argv)
voidverify()
Verifies the signature on this CertificationRequest.
voidverify(PublicKey key)
Verifies the signature on this CertificationRequest, using the given public key.
voidverify(PublicKey key, CryptoToken token)
Verifies the signature on this CertificationRequest, using the given public key and CryptoToken.

Constructor Detail

CertificationRequest

public CertificationRequest(CertificationRequestInfo info, PrivateKey privKey, SignatureAlgorithm signingAlg)
Creates and signs an X.509 CertificationRequest.

Parameters: info A CertificationRequestInfo (TBSCertificationRequest), which specifies the actual information of the CertificationRequest. privKey The private key with which to sign the certificat. signingAlg The algorithm to use to sign the CertificationRequest. It must match the algorithm specified in the CertificationRequestInfo.

Throws: IOException If an error occurred while encoding the CertificationRequest. 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 CertificationRequest info. InvalidKeyException If the key does not match the signing algorithm. SignatureException If an error occurs while signing the CertificationRequest.

Method Detail

encode

public void encode(OutputStream ostream)

encode

public void encode(Tag implicitTag, OutputStream ostream)

getInfo

public CertificationRequestInfo getInfo()
Returns the information (TBSCertificationRequest) contained in this CertificationRequest.

getTag

public Tag getTag()

getTemplate

public static CertificationRequest.Template getTemplate()

main

public static void main(String[] argv)

verify

public void verify()
Verifies the signature on this CertificationRequest. Does not indicate that the CertificationRequest is valid at any specific time.

verify

public void verify(PublicKey key)
Verifies the signature on this CertificationRequest, using the given public key. Does not indicate the CertificationRequest is valid at any specific time.

verify

public void verify(PublicKey key, CryptoToken token)
Verifies the signature on this CertificationRequest, using the given public key and CryptoToken. Does not indicate the CertificationRequest is valid at any specific time.