|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.crmf.Control
This class is the superclass of all Control objects.
Control ::= SEQUENCE { type OBJECT IDENTIFIER value ANY DEFINED BY type } |
See Also
Field Summary |
|
static int |
AUTHENTICATOR
This flag indicates an Authenticator control defined in CRMF. |
static int |
NON_STANDARD
This flag indicates a non-standard control. |
static int |
OLD_CERT_ID
This flag indicates an OldCertID control defined in CRMF. |
static int |
PKI_ARCHIVE_OPTIONS
This flag indicates a PKIArchiveOptions control defined in CRMF. |
static int |
PKI_PUBLICATION_INFO
This flag indicates a PKIPublicationInfo control defined in CRMF. |
static int |
PROTOCOL_ENCR_KEY
This flag indicates a ProtocolEncryptionKey control defined in CRMF. |
static int |
REG_TOKEN
This flag indicates a RegistrationToken control defined in CRMF. |
Constructor Summary |
|
Control()
|
Method Summary |
|
abstract Object |
clone()
Overrides the default |
boolean |
compareOID(byte[] oid)
Compares the OID of this control to oid. |
int |
derEncodeControlLen(int special,
int valueLen)
Returns the number of bytes the DER-encoding of this control will be. |
abstract boolean |
equals(Object obj)
Returns |
int |
getControlType()
Gets the control type. |
getControlTypeString()
Gets the name of the control type. |
|
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the control in this object into encoding, beginning at offset. |
int |
getDERLen(int special)
Returns the number of bytes of the DER encoding of this control. |
static Control |
getInstance(byte[] controlBER,
int offset,
int special)
Use this constructor, if not using PKIArchiveOptions control. |
static Control |
getInstance(byte[] controlBER,
int offset,
int special,
CertJ certJ,
CertPathCtx pathCtx,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Use this constructor, if using PKIArchiveOptions control. |
static int |
getNextBEROffset(byte[] controlBER,
int offset)
Given controlBER, the BER encoding of a control beginning at offset, finds the index to the next element in the encoding. |
byte[] |
getOID()
Gets the OID of this control. |
boolean |
isControlType(int type)
Checks to see if this object is of the type represented by the given type, which should be one of the "flags" listed above. |
void |
setEnvironment(CertJ certJ,
CertPathCtx pathCtx,
com.rsa.jsafe.JSAFE_PublicKey pubKey,
com.rsa.jsafe.JSAFE_PrivateKey privKey)
Sets 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 |
Field Detail |
public static final int REG_TOKEN
public static final int AUTHENTICATOR
public static final int PKI_PUBLICATION_INFO
public static final int PKI_ARCHIVE_OPTIONS
public static final int OLD_CERT_ID
public static final int PROTOCOL_ENCR_KEY
public static final int NON_STANDARD
Constructor Detail |
public Control()
Method Detail |
public static Control getInstance(byte[] controlBER, int offset, int special, CertJ certJ, CertPathCtx pathCtx, com.rsa.jsafe.JSAFE_PublicKey pubKey, com.rsa.jsafe.JSAFE_PrivateKey privKey) throws CRMFException
Control ::= SEQUENCE { type OBJECT IDENTIFIER value ANY DEFINED BY type } |
control [1] EXPLICIT Control |
control [1] EXPLICIT Control |
special = (ASN1.CONTEXT_EXPLICIT | 1)
;
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
controlBER | The BER-encoding of a control. | ||
offset | The offset into controlBER where the encoding begins. | ||
special | The special BER circumstances of the encoding, if there are any. | ||
certJ | CertJ object that contains environment information | ||
pathCtx | The | ||
pubKey | Public key used to encrypt the Secret key in the
EncryptedValue structure (pass | ||
privKey | Private key used to decrypt the Secret key in
EncryptedValue structure (pass |
Returns
Throws
CRMFException
- If the BER encoding is invalid.public static Control getInstance(byte[] controlBER, int offset, int special) throws CRMFException
Control ::= SEQUENCE { type OBJECT IDENTIFIER value ANY DEFINED BY type } |
control [1] EXPLICIT Control |
control [1] EXPLICIT Control |
special = (ASN1.CONTEXT_EXPLICIT | 1)
;
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
controlBER | The BER encoding of a control. | ||
offset | The offset into controlBER where the encoding begins. | ||
special | The special BER circumstances of the encoding, if there are any. |
Returns
Throws
CRMFException
- If the BER encoding is invalid.public String getControlTypeString()
Returns
String
describing the control type.public byte[] getOID()
Returns
byte
array that contains the OID.public boolean compareOID(byte[] oid)
Parameters
oid | A |
public int getControlType()
Returns
public int getDERLen(int special) throws CRMFException
0
.
The ASN.1 definition of Control is:
Control ::= SEQUENCE { . . . } |
control [1] EXPLICIT Control |
control [1] EXPLICIT Control |
special = (ASN1.CONTEXT_EXPLICIT | 1)
;
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 encoding error.public static int getNextBEROffset(byte[] controlBER, int offset) throws CRMFException
Parameters
controlBER | The BER-encoding of a control. | ||
offset | The offset into controlBER where the encoding begins. |
Returns
Throws
CRMFException
- If the method cannot read the BER
encoding.public int getDEREncoding(byte[] encoding, int offset, int special) throws CRMFException
getDERLen
. If this object
is not yet set with a control, this method will throw an exception.
The ASN.1 definition of Control is:
Control ::= SEQUENCE { type OBJECT IDENTIFIER value ANY DEFINED BY type } |
control [1] EXPLICIT Control |
control [1] EXPLICIT Control |
special = (ASN1.CONTEXT_EXPLICIT | 1)
;
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
.
Returns
Throws
CRMFException
- If the method cannot create the BER
encoding.public boolean isControlType(int type)
Parameters
type | The flag to check. |
Returns
public int derEncodeControlLen(int special, int valueLen) throws CRMFException
Control ::= SEQUENCE { . . . } |
control [1] EXPLICIT Control |
control [1] EXPLICIT Control |
special = (ASN1.CONTEXT_EXPLICIT | 1)
;
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 encoding error.public void setEnvironment(CertJ certJ, CertPathCtx pathCtx, com.rsa.jsafe.JSAFE_PublicKey pubKey, com.rsa.jsafe.JSAFE_PrivateKey privKey) throws CRMFException
Parameters
certJ | A | ||
pathCtx | The | ||
pubKey | Public key used to encrypt the Secret key in
EncryptedValue structure (pass | ||
privKey | Private key used to decrypt the Secret key in
EncryptedValue structure (pass |
Throws
CRMFException
- If the specified values are null
.public abstract boolean equals(Object obj)
true
if this object and obj contain
the same control; returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | The instance of Control object. |
Returns
boolean
that indicates whether
these objects are equal.public abstract 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 |