|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.attributes.X501Attribute
This class is the superclass of all X.501 attribute objects.
Attribute ::= SEQUENCE { type AttributeType, values SET OF AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY |
See Also
Field Summary |
|
static int |
CHALLENGE_PASSWORD
Indicates a challenge password attribute. |
static int |
CONTENT_TYPE
Indicates a content type attribute, defined in PKCS #9. |
static int |
COUNTRY_OF_CITIZENSHIP
Indicates a Country Of Citizenship attribute, defined in PKCS #9. |
static int |
COUNTRY_OF_RESIDENCE
Indicates a Country Of Residence attribute, defined in PKCS #9. |
static int |
CRS_DUAL_STATUS
Indicates a VeriSign-defined CRS dual enrollment status attribute. |
static int |
CRS_FAILURE_INFO
Indicates a VeriSign-defined CRS failure info attribute. |
static int |
CRS_MESSAGE_TYPE
Indicates a VeriSign-defined CRS message type attribute. |
static int |
CRS_PKI_STATUS
Indicates a VeriSign-defined CRS PKI status attribute. |
static int |
CRS_RECIPIENT_NONCE
Indicates a VeriSign-defined CRS recipient nonce attribute. |
static int |
CRS_SENDER_NONCE
Indicates a VeriSign-defined CRS sender nonce attribute. |
static int |
CRS_TRANSACTION_ID
Indicates a VeriSign-defined CRS transaction ID attribute. |
static int |
CRS_VERSION
Indicates a VeriSign-defined CRS version attribute. |
static int |
DATE_OF_BIRTH
Indicates a Date Of Birth attribute, defined in PKCS #9. |
static int |
FRIENDLY_NAME
Indicates a friendly name attribute. |
static int |
GENDER
Indicates a Gender attribute, defined in PKCS #9. |
static int |
LOCAL_KEY_ID
Indicates a local key ID attribute. |
static int |
MESSAGE_DIGEST
Indicates a message digest attribute, defined in PKCS #9. |
static int |
NON_STANDARD
Indicates a non-standard attribute. |
static int |
PLACE_OF_BIRTH
Indicates a Place Of Birth attribute, defined in PKCS #9. |
static int |
POSTAL_ADDRESS
Indicates a Postal Address attribute defined in X.520. |
static int |
PSEUDONYM
Indicates a Pseudonym attribute, defined in PKCS #9. |
static int |
SIGNING_TIME
Indicates a signing time attribute. |
static int |
SMART_CSP
Indicates a VeriSign-defined smart CSP attribute. |
static int |
X509_V3_EXTENSION
Indicates an X.509 v3 extension. |
Constructor Summary |
|
X501Attribute()
|
Method Summary |
|
void |
clearSensitiveData()
Clears any sensitive data. |
abstract Object |
clone()
Overrides the default |
boolean |
compareOID(byte[] oid)
Compares the OID of this attribute to oid. |
int |
derEncodeAttributeLen(int special,
int valueLen)
Returns the number of bytes of the DER encoding of this attribute. |
int |
getAttributeType()
Gets the attribute type. |
getAttributeTypeString()
Gets the name of the attribute type. |
|
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the attribute in this object into encoding, beginning at offset. |
int |
getDERLen(int special)
Returns the number of bytes of the DER encoding of this attribute. |
static X501Attribute |
getInstance(byte[] attributeBER,
int offset,
int special)
Creates an attribute based on attributeBER, the BER encoding of an attribute. |
static int |
getNextBEROffset(byte[] attributeBER,
int offset)
Finds the index to the next element in the encoding, beginning at offset, given attributeBER, the BER encoding of an X.501 attribute. |
byte[] |
getOID()
Gets the OID of this attribute. |
boolean |
isAttributeType(int type)
Checks whether this object is of the type represented by the given type, which should be one of the fields listed in this class. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SIGNING_TIME
public static final int CHALLENGE_PASSWORD
public static final int X509_V3_EXTENSION
public static final int FRIENDLY_NAME
public static final int LOCAL_KEY_ID
public static final int SMART_CSP
public static final int CRS_MESSAGE_TYPE
public static final int CRS_PKI_STATUS
public static final int CRS_FAILURE_INFO
public static final int CRS_SENDER_NONCE
public static final int CRS_RECIPIENT_NONCE
public static final int CRS_TRANSACTION_ID
public static final int CRS_VERSION
public static final int CRS_DUAL_STATUS
public static final int CONTENT_TYPE
public static final int MESSAGE_DIGEST
public static final int POSTAL_ADDRESS
public static final int PSEUDONYM
public static final int DATE_OF_BIRTH
public static final int PLACE_OF_BIRTH
public static final int GENDER
public static final int COUNTRY_OF_CITIZENSHIP
public static final int COUNTRY_OF_RESIDENCE
public static final int NON_STANDARD
Constructor Detail |
public X501Attribute()
Method Detail |
public static X501Attribute getInstance(byte[] attributeBER, int offset, int special) throws AttributeException
0x30
. However, an
attribute can be part of some other construct, and it might
have a different tag, caused by IMPLICIT
or
EXPLICIT
. For example, suppose the definition is as
follows:
attribute [1] EXPLICIT Attribute |
Attribute
should
follow special circumstances, use the special argument.
Set special to any special instructions of the
BER-encoding. For example, to indicate the following:
attribute [1] EXPLICIT Attribute |
special = (ASN1.CONTEXT_EXPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
attributeBER | The BER-encoding of an attribute. | ||
offset | The offset into attributeBER where the encoding begins. | ||
special | The special BER circumstances of the encoding, if there are any. |
Returns
X501Attribute
object.
The return is actually a subclass of X501Attribute
,
an object of the class associated with the attribute type.
Throws
AttributeException
- If the BER encoding is invalid.public String getAttributeTypeString()
Returns
String
describing the attribute type.public byte[] getOID()
Returns
byte
array that contains the OID.public boolean compareOID(byte[] oid)
Parameters
oid | A |
Returns
true
if oid is
equal to the OID of this attribute; false
otherwise.public int getAttributeType()
Returns
int
specifying which attribute type is represented in
this object.public int getDERLen(int special)
attribute [1] EXPLICIT Attribute |
Attribute
,
indicating the special nature of
this particular encoding, use the special argument.
Set that argument to any special
instructions of the DER encoding. For instance, to indicate
attribute [1] EXPLICIT Attribute |
special = (ASN1.CONTEXT_EXPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
special | The special circumstances of the DER encoding, if there are any. |
Returns
public static int getNextBEROffset(byte[] attributeBER, int offset) throws AttributeException
attributeBER[120]
is the first byte in the
encoding of the attribute, attributeBER[1938]
is the last byte in the encoding of the attribute, and the next
element begins at index 1939.
Parameters
attributeBER | The BER encoding of the X.501 attribute. | ||
offset | The offset into attributeBER where the encoding begins. |
Returns
int
that contains the index to the
next element in the BER encoding.
Throws
AttributeException
- If the method cannot read the BER
encoding.public int getDEREncoding(byte[] encoding, int offset, int special) throws AttributeException
getDERLen
. If this
object is not yet set with an attribute, then this method
throws an exception.
The ASN.1 definition means the tag will be 0x30. However, an
attribute can be part of some other construct, and it might
have a different tag, caused by IMPLICIT
or
EXPLICIT
. For example, suppose the definition is:
attribute [1] EXPLICIT Attribute |
Attribute
should follow special
circumstances, use the special argument. Set
special to any special instructions of the BER-encoding.
For example, to indicate the following:
attribute [1] EXPLICIT Attribute |
special = (ASN1.CONTEXT_EXPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
encoding | A | ||
offset | The offset into encoding where the encoding actually begins. | ||
special | The special circumstances of the DER encoding, if
there are any, such as |
Returns
Throws
AttributeException
- If the method cannot create the BER
encoding.public boolean isAttributeType(int type)
Parameters
type | The attribute type to check. |
Returns
boolean
indicating whether this object's type
matches type.public int derEncodeAttributeLen(int special, int valueLen)
IMPLICIT
or EXPLICIT
. This
can affect the length. For example, suppose the definition is as follows:
attribute [1] EXPLICIT Attribute |
Attribute
,
indicating the special nature of this
particular encoding, use the special argument. Set
special to any special instructions of the DER encoding.
For example, to indicate the following:
attribute [1] EXPLICIT Attribute |
special = (ASN1.CONTEXT_EXPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
special | The special circumstances of the DER encoding, if there are any. | ||
valueLen | Specifies the length of this attribute's value. |
Returns
public abstract Object clone() throws CloneNotSupportedException
clone
method to get a deeper clone.
Returns
X501Attribute
object, a copy of this object.
Throws
CloneNotSupportedException
- If the cloning operation
is not successful.public void clearSensitiveData()
finalizer
will clear the data,
but the user cannot be sure when the garbage collector
will call the finalizer
.
This method allows the user to clear data as soon as possible.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |