|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.ExtensionAttributes
This class holds and builds an ExtensionAttribute
object that is used in the GeneralName
class.
ExtensionAttributes ::= SET SIZE (1..ub-extension-attributes) OF ExtensionAttribute ExtensionAttribute ::= SEQUENCE { extension-attribute-type [0] INTEGER (0..ub-extension-attributes), extension-attribute-value [1] ANY DEFINED BY extension-attribute-type } |
See Also
Constructor Summary |
|
ExtensionAttributes()
The default constructor for this class. |
|
ExtensionAttributes(byte[] valueBER,
int offset,
int special)
Constructs an |
Method Summary |
|
void |
addAttribute(ExtensionAttribute attr)
Adds one attribute to the |
clone()
Override the default |
|
boolean |
equals(Object obj)
Returns |
getAttribute(int index)
Gets the attribute specified by index from
this |
|
int |
getAttributeCount()
Gets the number of attributes. |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the
|
int |
getDERLen(int special)
Returns the length, in bytes, of the DER encoding of
this |
static int |
getNextBEROffset(byte[] nameBER,
int offset)
Given nameBER, the BER encoding of
an |
toString()
Returns a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExtensionAttributes(byte[] valueBER, int offset, int special) throws NameException
ExtensionAttributes
object and initializes it with the collection of
attributes represented by valueBER.Parameters
valueBER | A | ||
offset | The offset into valueBER where the encoding begins. | ||
special | The special circumstances of the BER encoding.
The following ASN.1 constants are
possible values for special:
|
Throws
NameException
- If the encoding is invalid.public ExtensionAttributes()
Method Detail |
public void addAttribute(ExtensionAttribute attr)
ExtensionAttributes
object.Parameters
attr | An attribute to be added to this object. |
public ExtensionAttribute getAttribute(int index) throws NameException
ExtensionAttributes
object.Parameters
index | An |
Returns
ExtensionAttribute
specified by index.
Throws
NameException
- If the
specified index is invalid.public int getAttributeCount()
Returns
public String toString()
String
that describes
this ExtensionAttributes
object.
Overrides
toString
in class Object
Returns
String
that describes
this ExtensionAttributes
object.public static int getNextBEROffset(byte[] nameBER, int offset) throws NameException
ExtensionAttributes
object,
beginning at offset, finds the index
to the next element
in the encoding. In other words, this method
gets the next
offset after the
ExtensionAttributes
object.
For example, if the offset is 120 and
the ExtensionAttributes
object's
BER encoding is 1819 bytes, then this method
will return 1939, the
index immediately following the
ExtensionAttributes
object. That is,
nameBER[120]
is the first byte in the
encoding of the ExtensionAttributes
object, nameBER[1938]
is the last byte in the
encoding of the ExtensionAttributes
object, and the next element begins at index 1939.Parameters
nameBER | The BER encoding of
an | ||
offset | The offset into nameBER where the encoding begins. |
Returns
Throws
NameException
- If the method cannot read the BER encoding.public int getDERLen(int special) throws NameException
ExtensionAttributes
object. If this
object is not set with values, this method
returns zero.Parameters
special | The special circumstances of the DER encoding,
if there are any.
The following ASN.1 constants are
possible values for special:
|
Returns
ExtensionAttributes
object.
Throws
NameException
- If the method cannot get
the BER encoding length.public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
ExtensionAttributes
object into
encoding, beginning at offset.
To determine the length of the encoding, call
getDERLen
. If this object is not
set with values, this method places nothing
into the encoding array and returns
zero. To indicate that the DER encoding should
follow any special instructions, use the
special argument.
For example, to indicate the following:
extension [1] IMPLICIT ExtensionPass in the following:
special = (ASN1.IMPLICIT | 1);If there are no special circumstances, pass in the following:
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 | ||
offset | The offest into encoding where writing begins. | ||
special | The special circumstances of the DER encoding,
if there are any.
The following ASN.1 constants are
possible values for special:
|
Returns
Throws
NameException
- If the method cannot
create the DER encoding.public boolean equals(Object obj)
true
if this object
and obj contain the same
ExtensionAttributes
;
false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method to get a deeper clone.
Returns
ExtensionAttributes object
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 |