FileDocCategorySizeDatePackage
DERUnknownTag.javaAPI DocAndroid 1.5 API1575Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1

DERUnknownTag

public class DERUnknownTag extends DERObject
We insert one of these when we find a tag we don't recognise.

Fields Summary
int
tag
byte[]
data
Constructors Summary
public DERUnknownTag(int tag, byte[] data)

param
tag the tag value.
param
data the octets making up the time.

        this.tag = tag;
        this.data = data;
    
Methods Summary
voidencode(DEROutputStream out)

        out.writeEncoded(tag, data);
    
public booleanequals(java.lang.Object o)

        if ((o == null) || !(o instanceof DERUnknownTag))
        {
            return false;
        }
        
        DERUnknownTag other = (DERUnknownTag)o;
        
        if (tag != other.tag)
        {
            return false;
        }
        
        if (data.length != other.data.length)
        {
            return false;
        }
        
        for (int i = 0; i < data.length; i++) 
        {
            if(data[i] != other.data[i])
            {
                return false;
            }
        }
        
        return true;
    
public byte[]getData()

        return data;
    
public intgetTag()

        return tag;
    
public inthashCode()

        byte[]  b = this.getData();
        int     value = 0;

        for (int i = 0; i != b.length; i++)
        {
            value ^= (b[i] & 0xff) << (i % 4);
        }

        return value ^ this.getTag();