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 AccessDescription(ASN1Sequence seq) { if (seq.size() != 2) { throw new IllegalArgumentException("wrong number of elements in sequence"); } accessMethod = DERObjectIdentifier.getInstance(seq.getObjectAt(0)); accessLocation = GeneralName.getInstance(seq.getObjectAt(1)); }
public AttributeTypeAndValue[] getRegInfo() { if (regInfo == null) { return null; } AttributeTypeAndValue[] results = new AttributeTypeAndValue[regInfo.size()]; for (int i = 0; i != results.length; i++) { results[i] = AttributeTypeAndValue.getInstance(regInfo.getObjectAt(i)); } return results; }
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); } } }
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; }
public TimeStampResp(ASN1Sequence seq) { Enumeration e = seq.getObjects(); // status pkiStatusInfo = PKIStatusInfo.getInstance(e.nextElement()); if (e.hasMoreElements()) { timeStampToken = ContentInfo.getInstance(e.nextElement()); } }
public KeyAgreeRecipientInfo(ASN1Sequence seq) { int index = 0; version = (DERInteger) seq.getObjectAt(index++); originator = OriginatorIdentifierOrKey.getInstance((ASN1TaggedObject) seq.getObjectAt(index++), true); if (seq.getObjectAt(index) instanceof ASN1TaggedObject) { ukm = ASN1OctetString.getInstance((ASN1TaggedObject) seq.getObjectAt(index++), true); } keyEncryptionAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++)); recipientEncryptedKeys = (ASN1Sequence) seq.getObjectAt(index++); }
public CrlID(ASN1Sequence seq) { Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { ASN1TaggedObject o = (ASN1TaggedObject) e.nextElement(); switch (o.getTagNo()) { case 0: crlUrl = DERIA5String.getInstance(o, true); break; case 1: crlNum = DERInteger.getInstance(o, true); break; case 2: crlTime = DERGeneralizedTime.getInstance(o, true); break; default: throw new IllegalArgumentException("unknown tag number: " + o.getTagNo()); } } }
/** * 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)); }
private RecipientEncryptedKey(ASN1Sequence seq) { identifier = KeyAgreeRecipientIdentifier.getInstance(seq.getObjectAt(0)); encryptedKey = (ASN1OctetString) seq.getObjectAt(1); }