|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.PersonalName
This class is used in the GeneralName
object.
PersonalName ::= SET { surname [0] PrintableString (SIZE (1. .ub-surname-length)), given-name [1] PrintableString (SIZE (1. .ub-given-name-length)) OPTIONAL, initials [2] PrintableString (SIZE (1. .ub-initials-length)) OPTIONAL, generation-qualifier [3] PrintableString (SIZE (1. .ub-generation-qualifier-length)) OPTIONAL } ub-surname-length INTEGER ::= 40 ub-given-name-length INTEGER ::= 16 ub-initials-length INTEGER ::= 5 ub-generation-qualifier-length INTEGER ::= 3 |
See Also
Constructor Summary |
|
PersonalName()
Constructs an empty |
|
PersonalName(byte[] nameBER,
int offset,
int special)
Creates a |
Method Summary |
|
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the
|
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of
this |
getGenerationQualifier()
Gets the generation qualifier. |
|
getGivenName()
Gets the given name. |
|
getInitials()
Gets the initials. |
|
static int |
getNextBEROffset(byte[] nameBER,
int offset)
Given nameBER, the BER encoding of an
|
getSurname()
Gets the surname value. |
|
void |
setGenerationQualifier(String name)
Sets the generation qualifier. |
void |
setGivenName(String name)
Sets the given name. |
void |
setInitials(String name)
Sets the initials. |
void |
setSurname(String name)
Sets the surname value. |
toString()
Returns a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PersonalName(byte[] nameBER, int offset, int special) throws NameException
PersonalName
object and initializes it
with the given values.Parameters
nameBER | A | ||
offset | The offset into nameBER where the encoding begins. | ||
special | The special circumstances of the BER encoding,
if there are any.
The following ASN.1 constants are
possible values for special:
|
Throws
NameException
- If the encoding is invalid.public PersonalName()
PersonalName
object.Method Detail |
public void setSurname(String name)
Parameters
name | A |
public void setGivenName(String name)
Parameters
name | A |
public void setInitials(String name)
Parameters
name | A |
public void setGenerationQualifier(String name)
Parameters
name | A |
public String getSurname()
Returns
String
that specifies the surname.public String getGivenName()
Returns
String
that specifies the
given name.public String getInitials()
Returns
String
that specifies the initials.public String getGenerationQualifier()
Returns
String
that specifies the
generation qualifier.public String toString()
String
that describes
this PersonalName
object.
Overrides
toString
in class Object
Returns
String
that describes
this PersonalName
object.public static int getNextBEROffset(byte[] nameBER, int offset) throws NameException
PersonalName
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 PersonalName
object is 1819
bytes, then this method will return 1939, the index
immediately following the PersonalName
object. That is, nameBER[120]
is the first
byte in the encoding of the PersonalName
object, nameBER[1938]
is the last byte in the
encoding of the PersonalName
object, and the
next element begins at index 1939.Parameters
nameBER | The BER encoding of a | ||
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)
PersonalName
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.
The following ASN.1 constants are
possible values for special:
|
Returns
public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
PersonalName
object into
encoding, beginning at offset. To determine
the length of the encoding, call 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:
extension [1] IMPLICIT Extension |
special = (ASN1.CONTEXT_IMPLICIT | 1); |
special = 0 |
APP_IMPLICIT
, APP_EXPLICIT
,
PRIVATE_IMPLICIT
, PRIVATE_EXPLICIT
,
OPTIONAL
, DEFAULT
,
CONTEXT_IMPLICIT
,
or CONTEXT_EXPLICIT
.Parameters
encoding | The | ||
offset | The offset 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
PersonalName
,
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of a |
Returns
boolean
that indicates whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
PersonalName
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 |