|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.OtherName
This class is used in the GeneralName
object.
OtherName ::= SEQUENCE { type-id OBJECT IDENTIFIER, value [0] EXPLICIT ANY DEFINED BY type-id } |
See Also
Constructor Summary |
|
OtherName()
Constructs an empty |
|
OtherName(byte[] typeId,
int typeOffset,
int typeLen,
byte[] value,
int valueOffset,
int valueLen)
Creates an |
Method Summary |
|
void |
addValues(byte[] typeId,
int typeOffset,
int typeLen,
byte[] value,
int valueOffset,
int valueLen)
Sets the value of the |
clone()
Overrides the default |
|
void |
decodeValue(byte[] valueBER,
int offset,
int special)
Decodes the value. |
boolean |
equals(Object obj)
Returns |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the this object into encoding, beginning at offset. |
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of
this |
static int |
getNextBEROffset(byte[] nameBER,
int offset)
Given nameBER, the BER encoding of an
|
byte[] |
getTypeID()
Returns the |
byte[] |
getValue()
Returns the value of the |
toString()
Gets a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OtherName()
OtherName
object.public OtherName(byte[] typeId, int typeOffset, int typeLen, byte[] value, int valueOffset, int valueLen)
OtherName
object and initializes it
with the given values.Parameters
typeId | The | ||
typeOffset | The offset into the typeId array. | ||
typeLen | The length of the data in the typeId array. | ||
value | The | ||
valueOffset | The offset into value array. | ||
valueLen | The length of the data in the value array. |
Method Detail |
public void decodeValue(byte[] valueBER, int offset, int special) throws NameException
Parameters
valueBER | The BER encoding of the object. | ||
offset | The offset into valueBER where the encoding begins. | ||
special | The special circumstances of the BER encoding, if there are any. See the class ASN1 for more information on special. |
Throws
NameException
- If the encoding is invalid
for this object.public void addValues(byte[] typeId, int typeOffset, int typeLen, byte[] value, int valueOffset, int valueLen)
OtherName
object.
Creates an OtherName
object and initializes it
with the given values.Parameters
typeId | The | ||
typeOffset | The offset into the typeId array. | ||
typeLen | The length of the data in the typeId array. | ||
value | The | ||
valueOffset | The offset into value array. | ||
valueLen | The length of the data in the value array. |
public byte[] getTypeID()
TypeId
value of
the OtherName
object.
Returns
TypeId
value of
the OtherName
object.public byte[] getValue()
OtherName
object.
Returns
OtherName
object.public String toString()
String
representation of
the OtherName
object.
Overrides
toString
in class Object
Returns
String
that describes
this OtherName
object.public static int getNextBEROffset(byte[] nameBER, int offset) throws NameException
OtherName
object, beginning at
offset, finds the index to the next element
in the encoding. In other words, gets the next
offset after the name.
For example, if the offset is 120 and the length of the
BER encoding of the ORAddress
object is 1819
bytes, then this method will return 1939, the index
immediately following the ORAddress
object. That is, nameBER[120]
is the first
byte in the encoding of the ORAddress
object, nameBER[1938]
is the last byte in the
encoding of the ORAddress
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
OtherName
object. If this object is not set
with values, this method returns zero.Parameters
special | The special DER circumstances of the encoding, if there are any. See the class ASN1 for more information on special. |
Returns
Throws
NameException
- If this method cannot get
the DER encoding.public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
getDERLen
. If
this object is not yet set with values, then this method
places nothing into the 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:
value [1] IMPLICIT OCTET STRING |
special = (ASN1.CONTEXT_IMPLICIT | 1); |
special = 0 |
Parameters
encoding | The | ||
offset | The offset into encoding where writing begins. | ||
special | The special circumstances of the DER encoding, if there are any. See the class ASN1 for more information on 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
OtherName
;
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the |
Returns
public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
OtherName
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 |