Methods Summary |
---|
abstract void | encode(DEROutputStream out)
|
public boolean | equals(java.lang.Object o)
if (o == null || !(o instanceof DEROctetString))
{
return false;
}
DEROctetString other = (DEROctetString)o;
byte[] b1 = other.getOctets();
byte[] b2 = this.getOctets();
if (b1.length != b2.length)
{
return false;
}
for (int i = 0; i != b1.length; i++)
{
if (b1[i] != b2[i])
{
return false;
}
}
return true;
|
public static org.bouncycastle.asn1.ASN1OctetString | getInstance(ASN1TaggedObject obj, boolean explicit)return an Octet String from a tagged object.
return getInstance(obj.getObject());
|
public static org.bouncycastle.asn1.ASN1OctetString | getInstance(java.lang.Object obj)return an Octet String from the given object.
if (obj == null || obj instanceof ASN1OctetString)
{
return (ASN1OctetString)obj;
}
if (obj instanceof ASN1TaggedObject)
{
return getInstance(((ASN1TaggedObject)obj).getObject());
}
if (obj instanceof ASN1Sequence)
{
Vector v = new Vector();
Enumeration e = ((ASN1Sequence)obj).getObjects();
while (e.hasMoreElements())
{
v.addElement(e.nextElement());
}
return new BERConstructedOctetString(v);
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
|
public byte[] | getOctets()
return string;
|
public int | hashCode()
byte[] b = this.getOctets();
int value = 0;
for (int i = 0; i != b.length; i++)
{
value ^= (b[i] & 0xff) << (i % 4);
}
return value;
|