Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class DERIA5String

extends ASN1Primitive
implements ASN1String
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.ASN1String
Known Direct Subclasses
org.bouncycastle.asn1.misc.NetscapeRevocationURL, org.bouncycastle.asn1.misc.VerisignCzagExtension
Imports
java.io.IOException, org.bouncycastle.util.Arrays, .Strings

DER IA5String object - this is a ISO 646 (ASCII) string encoding code points 0 to 127.

Explicit character set escape sequences are not allowed.

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
DERIA5String(byte[]
the byte encoding of the characters making up the string.
string
)

Basic constructor - with bytes.

public
DERIA5String(String
the base string to use..
string
)

Basic constructor - without validation.

public
DERIA5String(String
the base string to wrap.
string
,
boolean
whether or not to check the string.
validate
)

Constructor with optional validation.

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
asn1Equals(ASN1Primitive o)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.
pack-priv void
pack-priv int
encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.
public static DERIA5String

Returns:

a DERIA5String instance, or null.
getInstance
(Object
a DERIA5String or an object that can be converted into one.
obj
)

Return an IA5 string from the passed in object

public static DERIA5String

Returns:

a DERIA5String instance, or null.
getInstance
(ASN1TaggedObject
the tagged object holding the object we want
obj
,
boolean
true if the object is meant to be explicitly tagged false otherwise.
explicit
)

Return an IA5 String from a tagged object.

public byte[]
public String
getString()

Implements org.bouncycastle.asn1.ASN1String.getString.

Return a Java String representation of this STRING type's content.
public int
hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Returns a hash code value for this object.
pack-priv boolean
isConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.
public static boolean

Returns:

true if character set in IA5String set, false otherwise.
isIA5String
(String
the string to check.
str
)

return true if the passed in String can be represented without loss as an IA5String, false otherwise.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.bouncycastle.asn1.ASN1Primitive:
equalsfromByteArraytoASN1PrimitivetoDERObjecttoDLObject

Field Detail

stringback to summary
private final byte[] string

Constructor Detail

DERIA5Stringback to summary
pack-priv DERIA5String(byte[] string)

Basic constructor - with bytes.

Parameters
string:byte[]

the byte encoding of the characters making up the string.

DERIA5Stringback to summary
public DERIA5String(String string)

Basic constructor - without validation.

Parameters
string:String

the base string to use..

DERIA5Stringback to summary
public DERIA5String(String string, boolean validate)

Constructor with optional validation.

Parameters
string:String

the base string to wrap.

validate:boolean

whether or not to check the string.

Exceptions
IllegalArgumentException:
if validate is true and the string contains characters that should not be in an IA5String.

Method Detail

asn1Equalsback to summary
pack-priv boolean asn1Equals(ASN1Primitive o)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Doc from org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

encodeback to summary
pack-priv void encode(ASN1OutputStream out) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

encodedLengthback to summary
pack-priv int encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.

Returns:int

the length of the object's encoding.

getInstanceback to summary
public static DERIA5String getInstance(Object obj)

Return an IA5 string from the passed in object

Parameters
obj:Object

a DERIA5String or an object that can be converted into one.

Returns:DERIA5String

a DERIA5String instance, or null.

Exceptions
IllegalArgumentException:
if the object cannot be converted.
getInstanceback to summary
public static DERIA5String getInstance(ASN1TaggedObject obj, boolean explicit)

Return an IA5 String from a tagged object.

Parameters
obj:ASN1TaggedObject

the tagged object holding the object we want

explicit:boolean

true if the object is meant to be explicitly tagged false otherwise.

Returns:DERIA5String

a DERIA5String instance, or null.

Exceptions
IllegalArgumentException:
if the tagged object cannot be converted.
getOctetsback to summary
public byte[] getOctets()
getStringback to summary
public String getString()

Implements org.bouncycastle.asn1.ASN1String.getString.

Doc from org.bouncycastle.asn1.ASN1String.getString.

Return a Java String representation of this STRING type's content.

Returns:String

a Java String representation of this STRING.

hashCodeback to summary
public int hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isConstructedback to summary
pack-priv boolean isConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Doc from org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

Returns:boolean

true if CONSTRUCTED bit set on object's tag, false otherwise.

isIA5Stringback to summary
public static boolean isIA5String(String str)

return true if the passed in String can be represented without loss as an IA5String, false otherwise.

Parameters
str:String

the string to check.

Returns:boolean

true if character set in IA5String set, false otherwise.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object