/** * Return the object held in this tagged object as a parser assuming it has * the type of the passed in tag. If the object doesn't have a parser * associated with it, the base object is returned. */ public ASN1Encodable getObjectParser( int tag, boolean isExplicit) { switch (tag) { case BERTags.SET: return ASN1Set.getInstance(this, isExplicit).parser(); case BERTags.SEQUENCE: return ASN1Sequence.getInstance(this, isExplicit).parser(); case BERTags.OCTET_STRING: return ASN1OctetString.getInstance(this, isExplicit).parser(); } if (isExplicit) { return getObject(); } throw new RuntimeException("implicit tagging not implemented for tag: " + tag); }
/** * Return the object held in this tagged object as a parser assuming it has * the type of the passed in tag. If the object doesn't have a parser * associated with it, the base object is returned. */ public ASN1Encodable getObjectParser( int tag, boolean isExplicit) throws IOException { switch (tag) { case BERTags.SET: return ASN1Set.getInstance(this, isExplicit).parser(); case BERTags.SEQUENCE: return ASN1Sequence.getInstance(this, isExplicit).parser(); case BERTags.OCTET_STRING: return ASN1OctetString.getInstance(this, isExplicit).parser(); } if (isExplicit) { return getObject(); } throw new ASN1Exception("implicit tagging not implemented for tag: " + tag); }