@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class PKCS10CertificateSigningRequest extends java.lang.Object implements java.io.Serializable
com.unboundid.asn1
package. The ASN.1 specification is as follows:
CertificationRequest ::= SEQUENCE { certificationRequestInfo CertificationRequestInfo, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING } CertificationRequestInfo ::= SEQUENCE { version INTEGER { v1(0) } (v1,...), subject Name, subjectPKInfo SubjectPublicKeyInfo, attributes [0] Attributes } SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING } PKInfoAlgorithms ALGORITHM ::= { ... -- add any locally defined algorithms here -- } Attributes ::= SET OF Attribute CRIAttributes ATTRIBUTE ::= { ... -- add any locally defined attributes here -- } Attribute ::= SEQUENCE { type OBJECT IDENTIFIER, values SET SIZE(1..MAX) } AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY OPTIONAL } SignatureAlgorithms ALGORITHM ::= { ... -- add any locally defined algorithms here -- }
Constructor and Description |
---|
PKCS10CertificateSigningRequest(byte[] encodedRequest)
Decodes the contents of the provided byte array as a PKCS #10 certificate
signing request.
|
Modifier and Type | Method and Description |
---|---|
static PKCS10CertificateSigningRequest |
generateCertificateSigningRequest(SignatureAlgorithmIdentifier signatureAlgorithm,
java.security.KeyPair keyPair,
DN subjectDN,
X509CertificateExtension... extensions)
Generates a PKCS #10 certificate signing request with the provided
information.
|
DecodedPublicKey |
getDecodedPublicKey()
Retrieves a decoded representation of the public key, if available.
|
ASN1BitString |
getEncodedPublicKey()
Retrieves the encoded public key as a bit string.
|
java.util.List<X509CertificateExtension> |
getExtensions()
Retrieves the list of certificate extensions included in the certificate
signing request.
|
byte[] |
getPKCS10CertificateSigningRequestBytes()
Retrieves the bytes that comprise the encoded representation of this
PKCS #10 certificate signing request.
|
java.lang.String |
getPublicKeyAlgorithmName()
Retrieves the certificate signing request public key algorithm name, if
available.
|
java.lang.String |
getPublicKeyAlgorithmNameOrOID()
Retrieves the public key algorithm name if it is available, or the string
representation of the public key algorithm OID if not.
|
OID |
getPublicKeyAlgorithmOID()
Retrieves the certificate signing request public key algorithm OID.
|
ASN1Element |
getPublicKeyAlgorithmParameters()
Retrieves the encoded public key algorithm parameters, if present.
|
java.util.List<ObjectPair<OID,ASN1Set>> |
getRequestAttributes()
Retrieves the encoded request attributes included in the certificate
signing request.
|
java.lang.String |
getSignatureAlgorithmName()
Retrieves the certificate signing request signature algorithm name, if
available.
|
java.lang.String |
getSignatureAlgorithmNameOrOID()
Retrieves the signature algorithm name if it is available, or the string
representation of the signature algorithm OID if not.
|
OID |
getSignatureAlgorithmOID()
Retrieves the certificate signing request signature algorithm OID.
|
ASN1Element |
getSignatureAlgorithmParameters()
Retrieves the encoded signature algorithm parameters, if present.
|
ASN1BitString |
getSignatureValue()
Retrieves the signature value for the certificate signing request.
|
DN |
getSubjectDN()
Retrieves the certificate signing request subject DN.
|
PKCS10CertificateSigningRequestVersion |
getVersion()
Retrieves the certificate signing request version.
|
java.util.List<java.lang.String> |
toPEM()
Retrieves a list of the lines that comprise a PEM representation of this
PKCS #10 certificate signing request.
|
java.lang.String |
toPEMString()
Retrieves a multi-line string containing a PEM representation of this
PKCS #10 certificate signing request.
|
java.lang.String |
toString()
Retrieves a string representation of the decoded X.509 certificate.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of the decoded X.509 certificate to the
provided buffer.
|
void |
verifySignature()
Verifies the signature for this certificate signing request.
|
public PKCS10CertificateSigningRequest(@NotNull byte[] encodedRequest) throws CertException
encodedRequest
- The byte array containing the encoded PKCS #10
certificate signing request. This must not be
null
.CertException
- If the contents of the provided byte array could
not be decoded as a valid PKCS #10 certificate
signing request.@NotNull public static PKCS10CertificateSigningRequest generateCertificateSigningRequest(@NotNull SignatureAlgorithmIdentifier signatureAlgorithm, @NotNull java.security.KeyPair keyPair, @NotNull DN subjectDN, @Nullable X509CertificateExtension... extensions) throws CertException
signatureAlgorithm
- The algorithm to use to generate the signature.
This must not be null
.keyPair
- The key pair to use for the certificate signing
request. This must not be null
.subjectDN
- The subject DN for the certificate signing
request. This must not be null
.extensions
- The set of extensions to include in the
certificate signing request. This may be
null
or empty if the request should not
include any custom extensions.CertException
- If a problem is encountered while creating the
certificate signing request.@NotNull public byte[] getPKCS10CertificateSigningRequestBytes()
@NotNull public PKCS10CertificateSigningRequestVersion getVersion()
@NotNull public OID getSignatureAlgorithmOID()
@Nullable public java.lang.String getSignatureAlgorithmName()
null
if the signature algorithm OID does not correspond to
any known algorithm name.@NotNull public java.lang.String getSignatureAlgorithmNameOrOID()
@Nullable public ASN1Element getSignatureAlgorithmParameters()
null
if
there are no signature algorithm parameters.@NotNull public DN getSubjectDN()
@NotNull public OID getPublicKeyAlgorithmOID()
@Nullable public java.lang.String getPublicKeyAlgorithmName()
null
if the public key algorithm OID does not correspond
to any known algorithm name.@NotNull public java.lang.String getPublicKeyAlgorithmNameOrOID()
@Nullable public ASN1Element getPublicKeyAlgorithmParameters()
null
if
there are no public key algorithm parameters.@NotNull public ASN1BitString getEncodedPublicKey()
@Nullable public DecodedPublicKey getDecodedPublicKey()
null
if the
public key could not be decoded.@NotNull public java.util.List<ObjectPair<OID,ASN1Set>> getRequestAttributes()
@NotNull public java.util.List<X509CertificateExtension> getExtensions()
@NotNull public ASN1BitString getSignatureValue()
public void verifySignature() throws CertException
CertException
- If the certificate signing request's signature
could not be verified.@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void toString(@NotNull java.lang.StringBuilder buffer)
buffer
- The buffer to which the information should be appended.@NotNull public java.util.List<java.lang.String> toPEM()
@NotNull public java.lang.String toPEMString()