Methods Summary |
---|
void | encode(DEROutputStream out)
OIDTokenizer tok = new OIDTokenizer(identifier);
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DEROutputStream dOut = new DEROutputStream(bOut);
writeField(bOut,
Integer.parseInt(tok.nextToken()) * 40
+ Integer.parseInt(tok.nextToken()));
while (tok.hasMoreTokens())
{
writeField(bOut, Integer.parseInt(tok.nextToken()));
}
dOut.close();
byte[] bytes = bOut.toByteArray();
out.writeEncoded(OBJECT_IDENTIFIER, bytes);
|
public boolean | equals(java.lang.Object o)
if ((o == null) || !(o instanceof DERObjectIdentifier))
{
return false;
}
return identifier.equals(((DERObjectIdentifier)o).identifier);
|
public java.lang.String | getId()
return identifier;
|
public static org.bouncycastle.asn1.DERObjectIdentifier | getInstance(java.lang.Object obj)return an OID from the passed in object
if (obj == null || obj instanceof DERObjectIdentifier)
{
return (DERObjectIdentifier)obj;
}
if (obj instanceof ASN1OctetString)
{
return new DERObjectIdentifier(((ASN1OctetString)obj).getOctets());
}
if (obj instanceof ASN1TaggedObject)
{
return getInstance(((ASN1TaggedObject)obj).getObject());
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
|
public static org.bouncycastle.asn1.DERObjectIdentifier | getInstance(ASN1TaggedObject obj, boolean explicit)return an Object Identifier from a tagged object.
return getInstance(obj.getObject());
|
public int | hashCode()
return identifier.hashCode();
|
private void | writeField(java.io.OutputStream out, int fieldValue)
if (fieldValue >= (1 << 7))
{
if (fieldValue >= (1 << 14))
{
if (fieldValue >= (1 << 21))
{
if (fieldValue >= (1 << 28))
{
out.write((fieldValue >> 28) | 0x80);
}
out.write((fieldValue >> 21) | 0x80);
}
out.write((fieldValue >> 14) | 0x80);
}
out.write((fieldValue >> 7) | 0x80);
}
out.write(fieldValue & 0x7f);
|