|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.crmf.CertReqMessages
This class contains the CertReqMessages, defined in Certificate Request Message Format (RFC 2511).
CertReqMessages ::= SEQUENCE SIZE (1...MAX) OF CertReqMsg CertReqMsg ::= SEQUENCE { certReq CertRequest pop ProofOfPossession OPTIONAL, -- content depends upon key type regInfo SEQUENCE SIZE (1...MAX) of AttributeTypeAndValue OPTIONAL } |
See Also
Constructor Summary |
|
CertReqMessages()
The default constructor for this class. |
|
CertReqMessages(CertRequest certRequest,
ProofOfPossession pop,
RegInfo regInfo)
Creates a |
Method Summary |
|
void |
addCertReqMsg(CertRequest certRequest,
ProofOfPossession pop,
RegInfo regInfo)
Adds a certificate request message to the list of the messages. |
clone()
Overrides the default |
|
void |
decodeCertReqMessages(byte[] certBER,
int offset,
int special)
This method decodes the BER-encoding of
a |
boolean |
equals(Object obj)
Returns |
int |
getCertReqMsgCount()
Gets the number of Certificate Request Messages in this object. |
getCertRequest(int index)
Gets the certificate request field of the
|
|
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the
|
int |
getDERLen(int special)
Returns the length of the DER encoding
of this |
static int |
getNextBEROffset(byte[] certBER,
int offset)
Given certBER, the BER of a
|
getPOP(int index)
Gets the |
|
getRegInfo(int index)
Gets the |
|
void |
setEnvironment(CertJ certJ,
CertPathCtx pathCtx,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Sets the environment variables. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CertReqMessages()
public CertReqMessages(CertRequest certRequest, ProofOfPossession pop, RegInfo regInfo) throws CRMFException
CertReqMessages
object
that and initializes it with the values given.Parameters
certRequest | The certificate request data. | ||
pop | The proof of possession. | ||
regInfo | The supplementary information related to the context of the certificate request. |
Throws
CRMFException
- If specified values are invalid.Method Detail |
public void addCertReqMsg(CertRequest certRequest, ProofOfPossession pop, RegInfo regInfo) throws CRMFException
Parameters
certRequest | The certificate request data. | ||
pop | The proof of possession. | ||
regInfo | The supplementary information related to the context of the certificate request. |
Throws
CRMFException
- If specified values are invalid.public void decodeCertReqMessages(byte[] certBER, int offset, int special) throws CRMFException
CertReqMessages
object
setting it with the value given by dataBER beginning at
offset.Parameters
certBER | The byte array that contains BER encoding of this object. | ||
offset | The offset into certBER. | ||
special | Any special instructions of the DER encoding. |
Throws
CRMFException
- If encoding is invalid.public void setEnvironment(CertJ certJ, CertPathCtx pathCtx, com.rsa.jsafe.JSAFE_PublicKey pubKey, com.rsa.jsafe.JSAFE_PrivateKey privKey)
keyEncipherment
or keyAgreement
proof of possession, or when using Controls
in CertRequest
.
If you are not sure if you have those POPs or Controls
set when decoding, set these environment variables.Parameters
certJ |
| ||
pathCtx | The | ||
pubKey | The public key used to encrypt the secret key in the
| ||
privKey | The public key used to decrypt the secret key in the
|
public CertRequest getCertRequest(int index) throws CRMFException
CertReqMsg
, specified by index.
It returns the actual object, not a clone.Parameters
index | The index that specifies the |
Returns
CertRequest
field of CertReqMsg
.
Throws
CRMFException
- If index is invalid.public ProofOfPossession getPOP(int index) throws CRMFException
ProofOfPossession
field of the CertReqMsg
, specified by index.
It returns the actual object, not a clone.Parameters
index | The index that dpecifies |
Returns
ProofOfPossession
field of CertReqMsg
.
Throws
CRMFException
- If index is invalid.public RegInfo getRegInfo(int index) throws CRMFException
RegInfo
field of the CertReqMsg
, specified by index.
It returns the actual object, not a clone.Parameters
index | The index that dpecifies |
Returns
RegInfo
field of CertReqMsg
.
Throws
CRMFException
- If index is invalid.public int getCertReqMsgCount()
Returns
public static int getNextBEROffset(byte[] certBER, int offset) throws CRMFException
CertReqMessages
object beginning
at offset, finds the index to the next
element in the encoding.
That is, this method gets the next offset after
the specified BER.
For example, if the offset is 120 and the BER
encoding is 1819 bytes, this method returns 1939, the index
immediately following the attributes. That is, certBER[120]
is the first byte in the encoding of the attributes,
certBER[1938]
is the last byte in the encoding of
the attributes, and the next element begins at index 1939.Parameters
certBER | The BER encoding of
a | ||
offset | The offset into nameBER where the encoding begins. |
Returns
int
that is the index to the
next element in the BER encoding.
Throws
CRMFException
- If the method cannot read the BER encoding.public int getDERLen(int special) throws CRMFException
CertReqMessages
object.
If this object is not set with values, returns 0
.Parameters
special | The special DER circumstances of the encoding, if there are any. |
Returns
CertReqMessages
object.public int getDEREncoding(byte[] encoding, int offset, int special) throws CRMFException
CertReqMessages
object into
encoding, beginning at offset. To determine
the length of the encoding, call getDERLen
. If
this object is not yet set with values, then this method
places nothing into the array and returns zero.
Use the special argument if the DER encoding
should follow any special instructions.
For example, to indicate the following:
data [1] IMPLICIT INTEGER |
special = (ASN1.IMPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
encoding | The | ||
offset | The offset into encoding where writing begins. | ||
special | The special circumstances of the DER encoding, if there are any. |
Returns
Throws
CRMFException
- If the method cannot
create the DER encoding.public boolean equals(Object obj)
true
if this object
and obj contain the same
CertReqMessages
; otherwise, false
.Overrides
equals
in class Object
Parameters
obj | The instance of the |
Returns
boolean
that indicates whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
CertReqMessages
object,
a copy of this object.
Throws
CloneNotSupportedException
- If the cloning operation
is not successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |