|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.crmf.POPOPrivKey
This class contains the POPOPrivKeyfield from the ProofOfPossesion.
POPOPrivKey ::= CHOICE { thisMessage [0] BIT STRING -- possesion is proven in this message (which contains the private key -- itself, encrypted and wrapped in EncryptedValue structure). subsequentMessage [1] SubsequentMessage, -- possession will be proven in subsequent message dhMAC [2] BIT STRING } -- for keyAgreement (only), possesion is proven in this message, -- (which contains a MAC (over the DER-encodedvalue of the -- certReq parameter in CertReqMsg, which MUST include both subject -- and publicKey) based on a key derived from the end entity's -- private DH key and the CA's public DH key); -- the dhMAC value MUST be calculated as per the directions given -- in Appendix A in CRMF. SubsequentMessage ::= INTEGER { encrCert (0), -- requests that resulting certificate be encrypted for the -- end entity (following which, POP will be proven in a -- confirmation message) challengeResp (1) } -- requests that CA/RA engage in challenge-response exchange with -- end entity in order to prove private key possession |
See Also
Field Summary |
|
static int |
CHALLENGE_RESPONSE
This flag indicates that SubsequenntMessage is of the type ChallengeResponse |
static int |
ENCRYPTED_CERT
This flag indicates that SubsequentMessage is of type EncryptedCerrtificate |
static int |
SUBSEQUENT_MESSAGE
This flag indicates that we are going to use "subsequentMessage" choice |
static int |
THIS_MESSAGE
This flag indicates that we are going to use "thisMessage" choice |
Constructor Summary |
|
POPOPrivKey()
Creates a POPOPrivKey |
Method Summary |
|
clone()
Overrides the default |
|
void |
decodePOPOPrivKey(byte[] keyBER,
int offset,
int special)
Decode the POPOPrivKey structure. |
boolean |
equals(Object obj)
Returns true if this object and obj contain the same POPOPrivKey, returns false otherwise. |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the POPOPrivKey object into encoding, beginning at offset. |
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of the POPOPrivKey. |
getEncryptedValue()
Gets the EncryptedValue object. |
|
static int |
getNextBEROffset(byte[] valueBER,
int offset)
Finds the index of the next element to encode, given valueBER, the BER of a POPOPrivKey beginning at offset. |
int |
getSubsequentMessage()
Gets the value of Subsequent Message |
int |
getType()
Gets the type of this POPOPrivKey structure |
void |
setEncryptedValue(EncryptedValue value)
Sets the EncryptedValue object, if this object is of
|
void |
setEnvironment(CertJ certJ,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Sets the environment variables; use this method only if use THIS_MESSAGE option. |
void |
setSubsequentMessage(int value)
Sets the value of Subsequent Message |
void |
setType(int type)
Set the type of this POPOPrivKey; one of the flags defined in this class. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int THIS_MESSAGE
public static final int SUBSEQUENT_MESSAGE
public static final int ENCRYPTED_CERT
public static final int CHALLENGE_RESPONSE
Constructor Detail |
public POPOPrivKey()
Method Detail |
public void setType(int type) throws CRMFException
Parameters
type | Type of this POPOPrivKey |
Throws
CRMFException
- If it is invalid typepublic int getType()
Returns
public void setEnvironment(CertJ certJ, com.rsa.jsafe.JSAFE_PublicKey pubKey, com.rsa.jsafe.JSAFE_PrivateKey privKey)
Parameters
certJ | CertJ object that contains environment information | ||
pubKey | Public key used to encrypt the Secret key in EncryptedValue structure (pass NULL if decoding) | ||
privKey | Private key used to decrypt the Secret key in EncryptedValue structure (pass NULL if encoding) |
public void setEncryptedValue(EncryptedValue value) throws CRMFException
THIS_MESSAGE
typeParameters
value | The strucure that contains the encrypted Private Key |
Throws
CRMFException
- If there is a cloning error; or if this object
is of SUBSEQUENT_MESSAGE
type; or if specified value is null.public EncryptedValue getEncryptedValue() throws CRMFException
Returns
THIS_MESSAGE
; if this value is not set, returns null
Throws
CRMFException
- If if there is a cloning error; or if this object
is of SUBSEQUENT_MESSAGE
typepublic void setSubsequentMessage(int value) throws CRMFException
Parameters
value | The type of the Subsequent Message: the resulting certificate will be encrypted for EE or CA/RA will engage in challenge-response exchange with EE; should be one of the flags defined in this class |
Throws
CRMFException
- If specified type is invalidpublic int getSubsequentMessage()
Returns
public void decodePOPOPrivKey(byte[] keyBER, int offset, int special) throws CRMFException
THIS_MESSAGE
type, user needs to set Recipient's
private key and CertJ object that contains environment
information before calling this method.Parameters
keyBER | The byte array that contains BER encoding of this object | ||
offset | Offset in this array | ||
special | That contains any special ASN.1 info, such as OPTIONAL |
Throws
CRMFException
- If encoding is invalidpublic static int getNextBEROffset(byte[] valueBER, int offset) throws CRMFException
Parameters
valueBER | The BER encoding of a POPOPrivKey | ||
offset | The offset into valueBER where the encoding begins |
Returns
Throws
CRMFException
- If the method cannot read the BER
encodingpublic int getDERLen(int special) throws CRMFException
Parameters
special | That contains any special ASN.1 info, such as OPTIONAL |
Returns
public int getDEREncoding(byte[] encoding, int offset, int special) throws CRMFException
data [1] IMPLICIT INTEGER |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
encoding | The byte array into which the result will be placed. | ||
offset | The offset into encoding where the writing is to begin. | ||
special | That contains any special ASN.1 info, such as OPTIONAL |
Returns
public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
Throws
CloneNotSupportedException
- If the cloning operation
is not successful.public boolean equals(Object obj)
Overrides
equals
in class Object
Parameters
obj | The instance of POPOPrivKey object |
Returns
boolean
that indicates whether
these objects are equal.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |