Package org.mozilla.jss.pkcs10
Class CertificationRequest
java.lang.Object
org.mozilla.jss.pkcs10.CertificationRequest
- All Implemented Interfaces:
ASN1Value
A pkcs10 signed CertificationRequest.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AlgorithmIdentifier
private CertificationRequestInfo
private byte[]
(package private) SEQUENCE
private byte[]
private static final Tag
private static final CertificationRequest.Template
-
Constructor Summary
ConstructorsConstructorDescriptionCertificationRequest
(CertificationRequestInfo info, PrivateKey privKey, SignatureAlgorithm signingAlg) Creates and signs an X.509 CertificationRequest.CertificationRequest
(CertificationRequestInfo info, AlgorithmIdentifier algId, byte[] signature) -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag implicitTag, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.getInfo()
Returns the information (TBSCertificationRequest) contained in this CertificationRequest.getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static void
void
verify()
Verifies the signature on this CertificationRequest.void
Verifies the signature on this CertificationRequest, using the given public key.void
verify
(PublicKey key, CryptoToken token) Verifies the signature on this CertificationRequest, using the given public key and CryptoToken.
-
Field Details
-
info
-
infoEncoding
private byte[] infoEncoding -
signature
private byte[] signature -
algId
-
sequence
SEQUENCE sequence -
TAG
-
templateInstance
-
-
Constructor Details
-
CertificationRequest
CertificationRequest(CertificationRequestInfo info, AlgorithmIdentifier algId, byte[] signature) throws IOException - Throws:
IOException
-
CertificationRequest
public CertificationRequest(CertificationRequestInfo info, PrivateKey privKey, SignatureAlgorithm signingAlg) throws IOException, NotInitializedException, TokenException, NoSuchAlgorithmException, CertificateException, InvalidKeyException, SignatureException 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 certificate.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.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 Details
-
verify
public void verify() throws InvalidKeyException, NotInitializedException, NoSuchAlgorithmException, CertificateException, TokenException, SignatureException, InvalidKeyFormatExceptionVerifies the signature on this CertificationRequest. Does not indicate that the CertificationRequest is valid at any specific time. -
verify
public void verify(PublicKey key) throws InvalidKeyException, NotInitializedException, NoSuchAlgorithmException, CertificateException, TokenException, SignatureException 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) throws NoSuchAlgorithmException, CertificateException, TokenException, SignatureException, InvalidKeyException Verifies the signature on this CertificationRequest, using the given public key and CryptoToken. Does not indicate the CertificationRequest is valid at any specific time. -
getInfo
Returns the information (TBSCertificationRequest) contained in this CertificationRequest. -
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
implicitTag
- Implicit tag.ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getTemplate
-
main
-