public final class PKCS10CertificationRequest
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 } Version ::= INTEGER Attributes ::= SET OF Attribute Attribute ::= SEQUENCE { type ATTRIBUTE.&id, values SET SIZE(1..MAX) OF ATTRIBUTE.&Type }
http://www.faqs.org/rfcs/rfc2314.html
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BASE64_ALTERNATIVE_TAG |
private static java.lang.String |
BASE64_TAG |
static java.lang.String |
FILE_EXTENSION
The file extension that should be used if a request is written to a file.
|
private CertificationRequest |
m_certificationRequest |
private java.lang.String |
m_md5Fingerprint |
private java.lang.String |
m_sha1Fingerprint |
Constructor and Description |
---|
PKCS10CertificationRequest(byte[] a_bytes)
Creates a PKCS10 Certification Request from an array of bytes.
|
PKCS10CertificationRequest(java.io.InputStream a_inputStream)
Creates a PKCS10 Certification Request from input stream.
|
PKCS10CertificationRequest(PKCS12 a_privateCertificate)
Creates a new PKCS10 Certification Request from a private certificate.
|
PKCS10CertificationRequest(X509DistinguishedName a_subject,
AsymmetricCryptoKeyPair a_keyPair,
MyX509Extensions a_extensions)
Creates a new PKCS10 Certification Request.
|
Modifier and Type | Method and Description |
---|---|
private void |
createFingerprints() |
JAPCertificate |
createX509Certificate(PKCS12 a_signerCertificate,
Validity a_validity,
MyX509Extensions a_extensions,
java.math.BigInteger a_serialNumber)
Creates a new X509 certificate from this certification request.
|
private byte[] |
getEncoded()
Returns a DER encoded byte array representing this request.
|
MyX509Extensions |
getExtensions()
Returns the extensions contained in this request.
|
java.lang.String |
getMD5Fingerprint()
Gets a human readable MD5 fingerprint for this request.
|
IMyPublicKey |
getPublicKey()
Returns the public key used in this request.
|
java.lang.String |
getSHA1Fingerprint()
Gets a human readable SHA1 fingerprint for this request.
|
X509DistinguishedName |
getX509DistinguishedName()
Get the X509 name that has been provided for this certification request.
|
byte[] |
toByteArray(boolean a_Base64Encoded)
Converts the request to a DER encoded byte array.
|
void |
toOutputStream(java.io.OutputStream a_out,
boolean a_Base64Encoded)
Writes the request to an output stream.
|
boolean |
verify()
Verifies the signature of this request with the public key included.
|
public static final java.lang.String FILE_EXTENSION
private static final java.lang.String BASE64_TAG
private static final java.lang.String BASE64_ALTERNATIVE_TAG
private CertificationRequest m_certificationRequest
private java.lang.String m_sha1Fingerprint
private java.lang.String m_md5Fingerprint
public PKCS10CertificationRequest(java.io.InputStream a_inputStream) throws java.io.IOException
a_inputStream
- an input stream representing a PKCS10 Certification Requestjava.io.IOException
- if an I/O error occurspublic PKCS10CertificationRequest(byte[] a_bytes)
a_bytes
- an array of bytes representing a PKCS10 Certification Requestpublic PKCS10CertificationRequest(X509DistinguishedName a_subject, AsymmetricCryptoKeyPair a_keyPair, MyX509Extensions a_extensions)
a_subject
- an X509 distinguished namea_keyPair
- a cryptographic key pair used to sign the requesta_extensions
- a set of attributes for this requestpublic PKCS10CertificationRequest(PKCS12 a_privateCertificate)
a_privateCertificate
- a private certificatepublic void toOutputStream(java.io.OutputStream a_out, boolean a_Base64Encoded) throws java.io.IOException
a_out
- OutputStreama_Base64Encoded
- booleanjava.io.IOException
public byte[] toByteArray(boolean a_Base64Encoded)
a_Base64Encoded
- if the data should additionally be Base64 encoded.public boolean verify()
public JAPCertificate createX509Certificate(PKCS12 a_signerCertificate, Validity a_validity, MyX509Extensions a_extensions, java.math.BigInteger a_serialNumber)
a_signerCertificate
- PKCS12a_validity
- the validity of the certificatea_extensions
- some X509 extensions (may be null); you may take the extensions from
this request after checking plausibilitya_serialNumber
- the serial number for this certificate (may be null); usually a
new serial number is created for each certificate created by the CApublic IMyPublicKey getPublicKey()
public java.lang.String getSHA1Fingerprint()
public java.lang.String getMD5Fingerprint()
public X509DistinguishedName getX509DistinguishedName()
public MyX509Extensions getExtensions()
private void createFingerprints()
private byte[] getEncoded()
Copyright © 2023. All rights reserved.