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

ASN1Explicit

public final class ASN1Explicit extends ASN1Constructured
This class represents explicitly tagged ASN.1 type.
see
ASN.1

Fields Summary
public final ASN1Type
type
Tagged type
Constructors Summary
public ASN1Explicit(int tagNumber, ASN1Type type)
Constructs explicitly tagged ASN.1 type with context-specific tag class and specified tag number.

param
tagNumber - ASN.1 tag number
param
type - ASN.1 type to be tagged
throws
IllegalArgumentException - if tagNumber is invalid

        this(CLASS_CONTEXTSPECIFIC, tagNumber, type);
    
public ASN1Explicit(int tagClass, int tagNumber, ASN1Type type)
Constructs explicitly tagged ASN.1 type.

param
tagClass - ASN.1 tag class.
param
tagNumber - ASN.1 tag number
param
type - ASN.1 type to be tagged
throws
IllegalArgumentException - if tagClass or tagNumber is invalid

        super(tagClass, tagNumber);

        this.type = type;
    
Methods Summary
public java.lang.Objectdecode(BerInputStream in)

        if (constrId != in.tag) {
            throw new ASN1Exception(
                    Messages.getString("security.13F", //$NON-NLS-1$
                    new Object[] { in.tagOffset, Integer.toHexString(constrId),
                            Integer.toHexString(in.tag) }));
        }
        in.next();

        in.content = type.decode(in);

        if (in.isVerify) {
            return null;
        }
        return getDecodedObject(in);
    
public voidencodeContent(BerOutputStream out)

        out.encodeExplicit(this);
    
public voidsetEncodingContent(BerOutputStream out)

        out.getExplicitLength(this);
    
public java.lang.StringtoString()

        //FIXME fix performance
        return super.toString() + " for type " + type; //$NON-NLS-1$