public class CertReqMsg
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object
Instances consist of the following elements:
CertRequest.ProofOfPossession.RegistrationInfo attributes, represented as an AttributeTypeAndValueList.Note: The CRMF specification explicitly requires that proof of possession be performed. Thus omitting the proof of possession value is only permissible if an out-of-band mechanism for POP is in place.
ProofOfPossession, CertReqMessages| Constructor and Description |
|---|
CertReqMsg()
Creates a new, empty
CertReqMsg. |
CertReqMsg(CertRequest certReq)
Creates a new
CertReqMsg from a certificate request, with no proof-of-possesion (assumes out-of-band POP will be done). |
CertReqMsg(CertRequest certReq, ProofOfPossession pop)
Creates a new CRMF
CertReqMsg from a certificate request, with the given proof-of-possession (not a SignaturePOP). |
CertReqMsg(CertRequest certReq, SignaturePOP pop, java.security.PrivateKey privKey)
Creates a new CRMF
CertReqMsg from a certificate request, with the given signature proof-of-possession. |
CertReqMsg(CertRequest certReq, SignaturePOP pop, java.security.PrivateKey privKey, java.security.SecureRandom sr)
Creates a new CRMF
CertReqMsg from a certificate request, with the given signature proof-of-possession. |
CertReqMsg(java.io.InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRegInfo(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
Adds the specified type-and-value pair to the registration info.
|
void |
addRegInfo(RegistrationInfo ri)
Adds the given
RegistrationInfo to this CertReqMsg. |
void |
assertSigPOPRules()
Checks the Signature POP rules are as per RFC 2511bis Section 4.4 comment text.
|
CertRequest |
getCertRequest()
Returns the certificate request contained in this message.
|
ProofOfPossession |
getPOP()
Returns the proof of possession value, or
null if it is not present in this message. |
oracle.security.crypto.cert.AttributeTypeAndValueList |
getRegInfo()
Returns the sequence of registration info, or
null if none are defined. |
void |
input(java.io.InputStream is) |
int |
length() |
void |
output(java.io.OutputStream os) |
java.lang.String |
toString() |
public CertReqMsg()
CertReqMsg. Since a valid instance must contain (at least) a CertRequest, this constructor is intended primarily for use with the input(java.io.InputStream) method.public CertReqMsg(CertRequest certReq)
CertReqMsg from a certificate request, with no proof-of-possesion (assumes out-of-band POP will be done).public CertReqMsg(CertRequest certReq, ProofOfPossession pop)
CertReqMsg from a certificate request, with the given proof-of-possession (not a SignaturePOP).
Note: This constructor must not be used with a signature POP; instead use CertReqMsg(CertRequest, SignaturePOP, PrivateKey).
public CertReqMsg(CertRequest certReq, SignaturePOP pop, java.security.PrivateKey privKey) throws java.security.SignatureException, java.security.NoSuchAlgorithmException
CertReqMsg from a certificate request, with the given signature proof-of-possession. If the signature has not yet been computed, it is computed here using the given private key.
Note the changes in the method signature
Previously public CertReqMsg (CertRequest, SignaturePOP , oracle.security.crypto.core.PrivateKey )
Nowpublic CertReqMsg (CertRequest , SignaturePOP , java.security.PrivateKey)
Note the change in the exceptions declared to be thrown.
Exceptions introduced -- NoSuchAlgorithmException,java.security.SignatureException
java.security.SignatureExceptionjava.security.NoSuchAlgorithmExceptionpublic CertReqMsg(CertRequest certReq, SignaturePOP pop, java.security.PrivateKey privKey, java.security.SecureRandom sr) throws java.security.SignatureException
CertReqMsg from a certificate request, with the given signature proof-of-possession. If the signature has not yet been computed, it is computed here using the given private key.
Note the changes in the method signature
Previously public CertReqMsg (CertRequest, SignaturePOP , oracle.security.crypto.core.PrivateKey , RandomBitsSource)
Nowpublic CertReqMsg (CertRequest , SignaturePOP , java.security.PrivateKey ,SecureRandom)
Note the change in the exceptions declared to be thrown.
Exceptions introduced -- java.security.SignatureException
java.security.SignatureException
public CertReqMsg(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic CertRequest getCertRequest()
public ProofOfPossession getPOP()
null if it is not present in this message.
public void assertSigPOPRules()
throws oracle.security.crypto.util.InvalidInputException
oracle.security.crypto.util.InvalidInputException - If the certTemplate contains both the subjectName and publicKey, and a POPOSigningKeyInput is present; or if the certTemplate is missing one or both of subjectName and publicKey, and the POPOSigningKeyInput is missing as well.public void addRegInfo(RegistrationInfo ri)
RegistrationInfo to this CertReqMsg.
public void addRegInfo(oracle.security.crypto.asn1.ASN1ObjectID type,
oracle.security.crypto.asn1.ASN1Object value)
type - the type OID.value - the value.public oracle.security.crypto.cert.AttributeTypeAndValueList getRegInfo()
null if none are defined.public java.lang.String toString()
toString in class java.lang.Object
public void input(java.io.InputStream is)
throws java.io.IOException
input in interface oracle.security.crypto.util.Streamablejava.io.IOException
public void output(java.io.OutputStream os)
throws java.io.IOException
output in interface oracle.security.crypto.util.Streamablejava.io.IOExceptionpublic int length()
length in interface oracle.security.crypto.util.Streamable