|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.security.pkcsutil.PKCSDerObject | +--com.ibm.security.pkcs10.CertificationRequest
A PKCS #10 certificate request is created and sent to a Certificate Authority, which then creates an X.509 certificate (or perhaps a PKCS #6 extended certificate) and returns it to the entity that requested it.
A certificate request basically consists of the subject's X.500 name, public key, and zero or more attributes, signed using the subject's private key.
The ASN.1 syntax for a Certification Request is:
CertificationRequest objects are immutable; they cannot be changed once created.
CertificationRequestInfo
,
AlgorithmId
Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
provider |
Constructor Summary | |
CertificationRequest(byte[] der)
Create a CertificationRequest object with a DER byte array. |
|
CertificationRequest(byte[] der,
String provname)
Create a CertificationRequest object with a DER byte array. |
|
CertificationRequest(CertificationRequestInfo info)
Constructs an unsigned PKCS #10 certificate request. |
|
CertificationRequest(CertificationRequestInfo certReqInfo,
PrivateKey privateKey,
String digest)
Constructs a signed PKCS #10 certificate request. |
|
CertificationRequest(CertificationRequestInfo certReqInfo,
PrivateKey privateKey,
String digest,
String provname)
Constructs a signed PKCS #10 certificate request. |
|
CertificationRequest(CertificationRequestInfo info,
String provname)
Constructs an unsigned PKCS #10 certificate request. |
|
CertificationRequest(String filename,
boolean base64)
Create a CertificationRequest with the filename of the DER-encoded or BASE64-encoded object. |
|
CertificationRequest(String filename,
boolean base64,
String provname)
Create a CertificationRequest with the filename of the DER-encoded or BASE64-encoded object. |
Method Summary | |
Object |
clone()
Creates a clone of this CertificationRequest object. |
protected void |
decode(com.ibm.security.pkcs10.DerValue encoding)
Initializes a CertificationRequest object from a DerValue. |
void |
encode(OutputStream os)
Encodes this object to an OutputStream. |
boolean |
equals(Object other)
Determines if this CertificationRequest object is equivalent to the input object. |
CertificationRequestInfo |
getCertRequestInfo()
Returns a reference to the certification request information. |
byte[] |
getSignature()
Returns a copy of the request signature. |
AlgorithmId |
getSignatureAlgorithm()
Returns a copy of the request signing algorithm identifier. |
int |
hashCode()
Returns a hashcode value for this certificate request from its encoded form. |
void |
print(PrintStream out)
Prints an E-Mailable version of the certificate request on the print stream passed. |
protected void |
readBASE64(String filename)
Read the BASE64 encoding of a DER-encode object from the input file and decode the contents into the current object. |
CertificationRequest |
sign(String digest,
PrivateKey key)
Creates a signature for this certificate request. |
String |
toString()
Provides a short description of this request. |
void |
verify()
Verifies the request's signature. |
void |
writeBASE64(String filename)
DER-encode the object and write the encoded bytes to the output file in BASE64 format. |
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject |
decode,
decode,
encode,
getObjectIdentifier,
read,
write,
write |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CertificationRequest(byte[] der) throws IOException
der
- a DER byte array encoding a CertificationRequest object.public CertificationRequest(byte[] der, String provname) throws IOException
der
- a DER byte array encoding a CertificationRequest object.provname
- a string containing the name of the java security provider
that the caller is usingpublic CertificationRequest(CertificationRequestInfo certReqInfo, PrivateKey privateKey, String digest) throws NoSuchAlgorithmException, IOException, PKCSException
info
- the information, including subject name, public key
and attributes, to include in the certification request.privateKey
- Private key used in signing.digest
- the digest used in the signing operation. Valid
values are MD2, MD5 and SHA when using RSA private keys, or SHA when
using DSA private keys.public CertificationRequest(CertificationRequestInfo certReqInfo, PrivateKey privateKey, String digest, String provname) throws NoSuchAlgorithmException, IOException, PKCSException
info
- the information, including subject name, public key
and attributes, to include in the certification request.privateKey
- Private key used in signing.digest
- the digest used in the signing operation. Valid
values are MD2, MD5 and SHA when using RSA private keys, or SHA when
using DSA private keys.provname
- a string containing the name of the java security provider
that the caller is usingpublic CertificationRequest(CertificationRequestInfo info)
info
- the CertificationRequestInfo object containing subject
name, public key and attibute information.public CertificationRequest(CertificationRequestInfo info, String provname)
info
- the CertificationRequestInfo object containing subject
name, public key and attibute information.provname
- a string containing the name of the java security provider
that the caller is usingpublic CertificationRequest(String filename, boolean base64) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedpublic CertificationRequest(String filename, boolean base64, String provname) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedprovname
- a string containing the name of the java security provider
that the caller is usingMethod Detail |
public void encode(OutputStream os) throws IOException
os
- the OutputStream to write the encoded data to.public CertificationRequest sign(String digest, PrivateKey key) throws PKCSException, SignatureException
digest
- the digest used in the signing operation. Valid
values are MD2, MD5 and SHA when using RSA private keys, or SHA when
using DSA private keys.key
- the private key used to sign the certification request
information.public void verify() throws IOException, SignatureException, NoSuchAlgorithmException
public boolean equals(Object other)
other
- the object to compare this one to.public int hashCode()
public Object clone()
public CertificationRequestInfo getCertRequestInfo()
public AlgorithmId getSignatureAlgorithm()
public byte[] getSignature()
public void print(PrintStream out) throws IOException, SignatureException
out
- the print stream where the certificate request
will be printed.public String toString()
public void writeBASE64(String filename) throws IOException
filename
- the file to write the BASE64 DER-encoded object to.protected void decode(com.ibm.security.pkcs10.DerValue encoding) throws IOException
encoding
- a DER-encoded CertificationRequest object.protected void readBASE64(String filename) throws IOException
If the file does not contain the header and footer, this method will attempt to decode the entire file.
filename
- the BASE64 file to read an object's DER encoding from.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |