|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.crmf.CertRequest
This class contains the CertRequest
field from CertReqMsg
message
defined in CertificateRequest Message Format (RFC 2511).
CertRequest ::= SEQUENCE { certReqId INTEGER, -- ID for matching request and reply certTemplate CertTemplate, -- Selected fields of cer to be issued controls Controls OPTIONAL } -- Attributes affecting issuance |
See Also
Constructor Summary |
|
CertRequest()
Constructs an empty |
|
CertRequest(int id,
CertTemplate template,
Controls controls)
Creates a |
Method Summary |
|
clone()
Overrides the default |
|
void |
decodeCertRequest(byte[] certBER,
int offset,
int special)
This method sets the values in this object with the value given by certBER beginning at offset, the BER encoding of a certificate request. |
boolean |
equals(Object obj)
Returns |
getCertTemplate()
Gets the certificate template. |
|
getControls()
Gets the Controls field. |
|
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the
|
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of the certificate request. |
static int |
getNextBEROffset(byte[] certBER,
int offset)
Given certBER, the BER of a
|
int |
getRequestID()
Gets the certificate request ID. |
void |
setCertTemplate(CertTemplate template)
Sets the cert template to be template. |
void |
setControls(Controls controls)
Sets the Controls field. |
void |
setEnvironment(CertJ certJ,
CertPathCtx pathCtx,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Sets the environment variables; use this method only if use controls, that need database / certificate verification operations (e.g., PKIArchiveOptions control). |
void |
setRequestID(int id)
Sets the certificate request ID to id. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CertRequest()
CertRequest
object.public CertRequest(int id, CertTemplate template, Controls controls) throws CRMFException
CertRequest
object
and initializes it with the given values.Parameters
id | The ID for matching the request and the reply. | ||
template | The selected fields of the certificate to be issued. | ||
controls | The attributes affecting issuance.
If the controls field is not set, pass |
Throws
CRMFException
- If the passed values are not valid.Method Detail |
public void decodeCertRequest(byte[] certBER, int offset, int special) throws CRMFException
CertJ
and CertPathCtx
objects) and the
recipient's public key and/or private keyParameters
certBER | The BER encoding of a certificate request. | ||
offset | The offset into certBER where the encoding begins. | ||
special | Any special BER/DER circumstances. |
Throws
CRMFException
- If the BER is not a valid
certificate request.public static int getNextBEROffset(byte[] certBER, int offset) throws CRMFException
CertRequest
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 void setRequestID(int id)
Parameters
id | The ID for matching request and reply. |
public int getRequestID()
Returns
public void setCertTemplate(CertTemplate template) throws CRMFException
Parameters
template | Selected fields of cert to be issued |
Throws
CRMFException
- If the cert template is not valid or NULL.public CertTemplate getCertTemplate() throws CRMFException
Returns
null
,
if the certificate template fields are not set.
Throws
CRMFException
- If there is a cloning error.public void setControls(Controls controls) throws CRMFException
Parameters
controls | Attributes affecting issuance |
Throws
CRMFException
- If the controls data is not validpublic Controls getControls() throws CRMFException
Returns
null
, if the controls field is not set.
Throws
CRMFException
- If there is a cloning error.public int getDERLen(int special) throws CRMFException
0
.Parameters
special | The special DER circumstances of the encoding, if there are any. |
Returns
public int getDEREncoding(byte[] encoding, int offset, int special) throws CRMFException
CertRequest
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 void setEnvironment(CertJ certJ, CertPathCtx pathCtx, com.rsa.jsafe.JSAFE_PublicKey pubKey, com.rsa.jsafe.JSAFE_PrivateKey privKey)
Parameters
certJ | CertJ object that contains environment information | ||
pathCtx | The CertPathCtx object that contains certificate path validation information (pass NULL if not using EnvelopedData option in EncryptedKey in PKIArchiveOptions control) | ||
pubKey | Public key used to encrypt the Secret key in EncryptedValue structure (pass NULL if decoding, or not using EncryptedValue option in EncryptedKey in PKIArchiveOptions control) | ||
privKey | Private key used to decrypt the Secret key in EncryptedValue structure (pass NULL if encoding, or not using EncryptedValue option in EncryptedKey in PKIArchiveOptions control) |
public boolean equals(Object obj)
true
if this object
and obj contain the same
CertRequest
; 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
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 |