FileDocCategorySizeDatePackage
ASN1Encodable.javaAPI DocAndroid 1.5 API1856Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1

ASN1Encodable

public abstract class ASN1Encodable extends Object implements DEREncodable

Fields Summary
public static final String
DER
public static final String
BER
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object o)

        if ((o == null) || !(o instanceof DEREncodable))
        {
            return false;
        }

        DEREncodable other = (DEREncodable)o;

        return this.toASN1Object().equals(other.getDERObject());
    
public byte[]getDEREncoded()
Return the DER encoding of the object, null if the DER encoding can not be made.

return
a DER byte array, null otherwise.

        try
        {
            return this.getEncoded(DER);
        }
        catch (IOException e)
        {
            return null;
        }
    
public DERObjectgetDERObject()

        
        return this.toASN1Object();
    
public byte[]getEncoded()

    
       
         
    
        ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
        ASN1OutputStream        aOut = new ASN1OutputStream(bOut);
        
        aOut.writeObject(this);
        
        return bOut.toByteArray();
    
public byte[]getEncoded(java.lang.String encoding)

        if (encoding.equals(DER))
        {
            ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
            DEROutputStream         dOut = new DEROutputStream(bOut);
            
            dOut.writeObject(this);
            
            return bOut.toByteArray();
        }
        
        return this.getEncoded();
    
public inthashCode()

        return this.toASN1Object().hashCode();
    
public abstract DERObjecttoASN1Object()