public class PKCS10
extends java.lang.Object
CertificationRequest ::= SEQUENCE {
certificationRequestInfo CertificationRequestInfo,
signatureAlgorithm SignatureAlgorithmIdentifier,
signature Signature
}
SignatureAlgorithmIdentifier ::= AlgorithmIdentifier
Signature ::= BIT STRING
CertificationRequestInfo ::= SEQUENCE {
version Version,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
attributes [0] IMPLICIT Attributes
}
Attributes ::= SET OF Attribute
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
PKCS10(byte[] data) |
PKCS10(byte[] data,
boolean sigver)
Parses an encoded, signed PKCS #10 certificate request, verifying
the request's signature as it does so.
|
PKCS10(X509Key publicKey)
Constructs an unsigned PKCS #10 certificate request.
|
PKCS10(X509Key publicKey,
PKCS10Attributes attributes)
Constructs an unsigned PKCS #10 certificate request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encodeAndSign(X500Signer requester)
Create the signed certificate request.
|
PKCS10Attributes |
getAttributes()
Returns the additional attributes requested.
|
byte[] |
getCertRequestInfo()
Retrieve the PKCS10 CertificateRequestInfo as a byte array
|
X500Name |
getSubjectName()
Returns the subject's name.
|
X509Key |
getSubjectPublicKeyInfo()
Returns the subject's public key.
|
void |
print(java.io.PrintStream out)
Prints an E-Mailable version of the certificate request on the print
stream passed.
|
byte[] |
toByteArray()
Returns the encoded and signed certificate request as a
DER-encoded byte array.
|
java.lang.String |
toString()
Provides a short description of this request.
|
public PKCS10(X509Key publicKey)
publicKey - the public key that should be placed
into the certificate generated by the CA.public PKCS10(X509Key publicKey, PKCS10Attributes attributes)
publicKey - the public key that should be placed
into the certificate generated by the CA.attributes - additonal set of PKCS10 attributes requested
for in the certificate.public PKCS10(byte[] data,
boolean sigver)
throws java.io.IOException,
java.security.SignatureException,
java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException
data - the DER-encoded PKCS #10 request.sigver - boolean specifies signature verification enabled or notjava.io.IOException - for low level errors reading the datajava.security.SignatureException - when the signature is invalidjava.security.NoSuchAlgorithmException - when the signature
algorithm is not supported in this environmentjava.security.NoSuchProviderExceptionpublic PKCS10(byte[] data)
throws java.io.IOException,
java.security.SignatureException,
java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException
java.io.IOExceptionjava.security.SignatureExceptionjava.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionpublic void encodeAndSign(X500Signer requester) throws java.security.cert.CertificateException, java.io.IOException, java.security.SignatureException
requester - identifies the signer (by X.500 name)
and provides the private key used to sign.java.io.IOException - on errors.java.security.cert.CertificateException - on certificate handling errors.java.security.SignatureException - on signature handling errors.public X500Name getSubjectName()
public X509Key getSubjectPublicKeyInfo()
public PKCS10Attributes getAttributes()
public byte[] toByteArray()
public void print(java.io.PrintStream out)
throws java.io.IOException,
java.security.SignatureException
out - the print stream where the certificate request
will be printed.java.io.IOException - when an output operation failedjava.security.SignatureException - when the certificate request was
not yet signed.public java.lang.String toString()
toString in class java.lang.Objectpublic byte[] getCertRequestInfo()