private static String outputApplicationSpecific( String type, String indent, boolean verbose, DERObject obj, String nl) { DERApplicationSpecific app = (DERApplicationSpecific) obj; StringBuffer buf = new StringBuffer(); if (app.isConstructed()) { try { ASN1Sequence s = ASN1Sequence.getInstance(app.getObject(DERTags.SEQUENCE)); buf.append(indent + type + " ApplicationSpecific[" + app.getApplicationTag() + "]" + nl); for (Enumeration e = s.getObjects(); e.hasMoreElements(); ) { _dumpAsString(indent + TAB, verbose, (DERObject) e.nextElement(), buf); } } catch (IOException e) { buf.append(e); } return buf.toString(); } return indent + type + " ApplicationSpecific[" + app.getApplicationTag() + "] (" + new String(Hex.encode(app.getContents())) + ")" + nl; }
public static CertReqMsg getInstance(Object o) { if (o instanceof CertReqMsg) { return (CertReqMsg) o; } else if (o != null) { return new CertReqMsg(ASN1Sequence.getInstance(o)); } return null; }
private CertReqMsg(ASN1Sequence seq) { Enumeration en = seq.getObjects(); certReq = CertRequest.getInstance(en.nextElement()); while (en.hasMoreElements()) { Object o = en.nextElement(); if (o instanceof ASN1TaggedObject || o instanceof ProofOfPossession) { popo = ProofOfPossession.getInstance(o); } else { regInfo = ASN1Sequence.getInstance(o); } } }
/** * return a KeyAgreeRecipientInfo object 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. * @exception IllegalArgumentException if the object held by the tagged object cannot be * converted. */ public static KeyAgreeRecipientInfo getInstance(ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
/** * return an RecipientEncryptedKey object 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. * @exception IllegalArgumentException if the object held by the tagged object cannot be * converted. */ public static RecipientEncryptedKey getInstance(ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }