|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanon.crypto.PKCS10CertificationRequest
public final class PKCS10CertificationRequest
A class for creating and verifying PKCS10 Certification requests. They are used to request certification for an X509 certificate from a certificate authority.
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
Field Summary | |
---|---|
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 Summary | |
---|---|
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,
X509Extensions a_extensions)
Creates a new PKCS10 Certification Request. |
Method Summary | |
---|---|
private void |
createFingerprints()
|
JAPCertificate |
createX509Certificate(PKCS12 a_signerCertificate,
Validity a_validity,
X509Extensions 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. |
X509Extensions |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public PKCS10CertificationRequest(java.io.InputStream a_inputStream) throws java.io.IOException
a_inputStream
- an input stream representing a PKCS10 Certification Request
java.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, X509Extensions 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 certificateMethod Detail |
---|
public void toOutputStream(java.io.OutputStream a_out, boolean a_Base64Encoded) throws java.io.IOException
a_out
- OutputStreama_Base64Encoded
- boolean
java.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, X509Extensions 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 CA
public IMyPublicKey getPublicKey()
public java.lang.String getSHA1Fingerprint()
public java.lang.String getMD5Fingerprint()
public X509DistinguishedName getX509DistinguishedName()
public X509Extensions getExtensions()
private void createFingerprints()
private byte[] getEncoded()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |