FileDocCategorySizeDatePackage
ASN1StringType.javaAPI DocAndroid 1.5 API4162Wed May 06 22:41:06 BST 2009org.apache.harmony.security.asn1

ASN1StringType

public abstract class ASN1StringType extends ASN1Type
This class is the super class for all string ASN.1 types
see
ASN.1

Fields Summary
public static final ASN1StringType
BMPSTRING
public static final ASN1StringType
IA5STRING
public static final ASN1StringType
GENERALSTRING
public static final ASN1StringType
PRINTABLESTRING
public static final ASN1StringType
TELETEXSTRING
public static final ASN1StringType
UNIVERSALSTRING
public static final ASN1StringType
UTF8STRING
Constructors Summary
public ASN1StringType(int tagNumber)


       
        super(tagNumber);
    
Methods Summary
public final booleancheckTag(int identifier)
Tests provided identifier.

param
identifier - identifier to be verified
return
- true if identifier correspond to primitive or constructed identifier of this ASN.1 string type, otherwise false

        return this.id == identifier || this.constrId == identifier;
    
public java.lang.Objectdecode(BerInputStream in)


        in.readString(this);
        
        if (in.isVerify) {
            return null;
        }
        return getDecodedObject(in);
    
public voidencodeASN(BerOutputStream out)

        out.encodeTag(id);
        encodeContent(out);
    
public voidencodeContent(BerOutputStream out)

        out.encodeString();
    
public java.lang.ObjectgetDecodedObject(BerInputStream in)
Extracts String object from BER input stream.

param
in - BER input stream
return
java.land.String object

        return new String(in.buffer, in.contentOffset, in.length);
    
public voidsetEncodingContent(BerOutputStream out)


        byte[] bytes = ((String) out.content).getBytes();

        out.content = bytes;
        out.length = bytes.length;