public class

DERPrintableString

extends ASN1Object
implements DERString
java.lang.Object
   ↳ org.bouncycastle.asn1.ASN1Encodable
     ↳ org.bouncycastle.asn1.DERObject
       ↳ org.bouncycastle.asn1.ASN1Object
         ↳ org.bouncycastle.asn1.DERPrintableString

Class Overview

DER PrintableString object.

Summary

[Expand]
Inherited Constants
From class org.bouncycastle.asn1.ASN1Encodable
From interface org.bouncycastle.asn1.DERTags
Public Constructors
DERPrintableString(byte[] string)
basic constructor - byte encoded string.
DERPrintableString(String string)
basic constructor - this does not validate the string
DERPrintableString(String string, boolean validate)
Constructor with optional validation.
Public Methods
static DERPrintableString getInstance(ASN1TaggedObject obj, boolean explicit)
return a Printable String from a tagged object.
static DERPrintableString getInstance(Object obj)
return a printable string from the passed in object.
byte[] getOctets()
String getString()
int hashCode()
static boolean isPrintableString(String str)
return true if the passed in String can be represented without loss as a PrintableString, false otherwise.
String toString()
[Expand]
Inherited Methods
From class org.bouncycastle.asn1.ASN1Object
From class org.bouncycastle.asn1.DERObject
From class org.bouncycastle.asn1.ASN1Encodable
From class java.lang.Object
From interface org.bouncycastle.asn1.ASN1String
From interface org.bouncycastle.asn1.DEREncodable

Public Constructors

public DERPrintableString (byte[] string)

basic constructor - byte encoded string.

public DERPrintableString (String string)

basic constructor - this does not validate the string

public DERPrintableString (String string, boolean validate)

Constructor with optional validation.

Parameters
string the base string to wrap.
validate whether or not to check the string.
Throws
IllegalArgumentException if validate is true and the string contains characters that should not be in a PrintableString.

Public Methods

public static DERPrintableString getInstance (ASN1TaggedObject obj, boolean explicit)

return a Printable String from a tagged object.

Parameters
obj the tagged object holding the object we want
explicit true if the object is meant to be explicitly tagged false otherwise.
Throws
IllegalArgumentException if the tagged object cannot be converted.

public static DERPrintableString getInstance (Object obj)

return a printable string from the passed in object.

Throws
IllegalArgumentException if the object cannot be converted.

public byte[] getOctets ()

public String getString ()

public int hashCode ()

public static boolean isPrintableString (String str)

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

Returns
  • true if in printable set, false otherwise.

public String toString ()