/** * Return an OBJECT IDENTIFIER from a tagged object. * * @param obj the tagged object holding the object we want * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @return an ASN1ObjectIdentifier instance, or null. * @throws IllegalArgumentException if the tagged object cannot * be converted. */ public static ASN1ObjectIdentifier getInstance( ASN1TaggedObject obj, boolean explicit) { ASN1Primitive o = obj.getObject(); if (explicit || o instanceof ASN1ObjectIdentifier) { return getInstance(o); } else { return ASN1ObjectIdentifier.fromOctetString(ASN1OctetString.getInstance(o).getOctets()); } }
/** * return an Object Identifier from a tagged object. * * @param obj the tagged object holding the object we want * @param explicit true if the object is meant to be explicitly * tagged false otherwise. * @throws IllegalArgumentException if the tagged object cannot * be converted. * @return an ASN1ObjectIdentifier instance, or null. */ public static ASN1ObjectIdentifier getInstance( ASN1TaggedObject obj, boolean explicit) { ASN1Primitive o = obj.getObject(); if (explicit || o instanceof ASN1ObjectIdentifier) { return getInstance(o); } else { return ASN1ObjectIdentifier.fromOctetString(ASN1OctetString.getInstance(obj.getObject()).getOctets()); } }
return new DERNumericString(defIn.toByteArray()); case OBJECT_IDENTIFIER: return ASN1ObjectIdentifier.fromOctetString(getBuffer(defIn, tmpBuffers)); case OCTET_STRING: return new DEROctetString(defIn.toByteArray());
return new DERNumericString(defIn.toByteArray()); case OBJECT_IDENTIFIER: return ASN1ObjectIdentifier.fromOctetString(getBuffer(defIn, tmpBuffers)); case OCTET_STRING: return new DEROctetString(defIn.toByteArray());