|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.crmf.Controls
This class builds and holds Controls defined in CRMF (RFC-2511). It holds the collection of controls, the Control class is where the data is stored, encoded and decoded.
In CRMF, Controls are defined as follows.Controls ::= SEQUENCE SIZE(1...MAX) OF Control Control ::= SEQUENCE { type OBJECT IDENTIFIER value ANY DEFINED BY type } |
See Also
Constructor Summary |
|
Controls()
Constructs an empty |
Method Summary |
|
int |
addControl(Control control)
Adds a new CRMF defined control. |
clone()
Overrides the default |
|
void |
decodeControls(byte[] controlsBER,
int offset,
int special)
This method decodes controlsBER encoding and sets the values in this object. |
boolean |
equals(Object obj)
Returns true if this object and obj contain the same Controls, returns false otherwise. |
getControlByIndex(int index)
Gets the control at the indexth position in the list. |
|
getControlByOID(byte[] oid)
Gets the control that is of the given oid. |
|
getControlByType(int controlType)
Gets the control that is of the given controlType. |
|
int |
getControlCount()
Determines the number of controls in this object. |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the Controls into encoding, beginning at offset. |
int |
getDERLen(int special)
Returns the number of bytes the DER encoding these Controls will be. |
static int |
getNextBEROffset(byte[] controlsBER,
int offset)
Finds the index of the next element in the encoded data, given controlsBER, the BER of CRMF controls beginning at offset. |
void |
setEnvironment(CertJ certJ,
CertPathCtx pathCtx,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Sets the a reference to the object that contains the database and certification path processing information. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Controls()
Controls
object.Method Detail |
public void decodeControls(byte[] controlsBER, int offset, int special) throws CRMFException
Controls ::= SEQUENCE SIZE(1...MAX) OF AttributeTypeAndValue |
controls [0] IMPLICIT Controls |
controls [0] IMPLICIT Controls |
special = (ASN1.CONTEXT_IMPLICIT | 0)
;
Of course, if there are no special circumstances, pass in
special = 0
.
The following ASN.1 constants are
possible values for special:
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
controlsBER | A | ||
offset | The offset into controlsBER where the encoding begins | ||
special | The special BER circumstances of the encoding, if there are any |
Throws
CRMFException
- If the encoding is invalidpublic static int getNextBEROffset(byte[] controlsBER, int offset) throws CRMFException
Parameters
controlsBER | The BER encoding of an X.501 controls | ||
offset | The offset into controlsBER where the encoding begins |
Returns
Throws
CRMFException
- If the method cannot read the BER
encodingpublic int getDERLen(int special) throws CRMFException
Controls ::= SEQUENCE SIZE(1...MAX) OF AttributeTypeAndValue |
controls [0] IMPLICIT Controls |
controls [0] IMPLICIT Controls |
special = (ASN1.CONTEXT_IMPLICIT | 0)
;
Of course, if there are no special circumstances, pass in
special = 0
.
The following ASN.1 constants are
possible values for special:
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
special | The special DER circumstances of the encoding, if there are any |
Returns
Throws
CRMFException
- If there is an error while encodingpublic int getDEREncoding(byte[] encoding, int offset, int special) throws CRMFException
Controls ::= SEQUENCE SIZE(1...MAX) OF AttributeTypeAndValue |
controls [0] IMPLICIT Controls |
controls [0] IMPLICIT Controls |
special = (ASN1.CONTEXT_IMPLICIT | 0)
;
Of course, if there are no special circumstances, pass in
special = 0
.
The following ASN.1 constants are
possible values for special:
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 | The special DER circumstances of the encoding, if there are any |
Returns
byte
array that contains the DER-encoding of the Controls
Throws
CRMFException
- If the DER cannot be computedpublic int addControl(Control control) throws CRMFException
Parameters
control | An object that contains the control type and value or values. See the Control class and its subclasses for information on building them. |
Returns
Throws
CRMFException
- If specified Control is null.public int getControlCount()
Returns
public Control getControlByIndex(int index) throws CRMFException
Parameters
index | The index into the list of the controls to retrieve |
Returns
Throws
CRMFException
- If the specified index is invalid, or ifpublic Control getControlByType(int controlType)
Parameters
controlType | The flag indicating which type. See the Control class for a list of possible values |
Returns
public Control getControlByOID(byte[] oid)
Parameters
oid | The byte array that contains the OID to compare |
Returns
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 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 Controls 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 |