/** * Change current SEQUENCE object to be encoded as {@link DLSequence}. * This is part of Direct Length form serialization. */ ASN1Primitive toDLObject() { ASN1Sequence dlSeq = new DLSequence(); dlSeq.seq = this.seq; return dlSeq; }
ASN1Primitive toDLObject() { ASN1Sequence dlSeq = new DLSequence(); dlSeq.seq = this.seq; return dlSeq; }
static ASN1Sequence createSequence(ASN1EncodableVector v) { return v.size() < 1 ? EMPTY_SEQUENCE : new DLSequence(v); }
static ASN1Sequence createSequence(ASN1EncodableVector v) { return v.size() < 1 ? EMPTY_SEQUENCE : new DLSequence(v); }
/** * Add a SafeBag that is to be included as is. * * @param data the SafeBag to add. * @return this builder. * @throws IOException */ public PKCS12PfxPduBuilder addData(PKCS12SafeBag data) throws IOException { dataVector.add(new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(new DLSequence(data.toASN1Structure()).getEncoded()))); return this; }
/** * Add a SafeBag that is to be included as is. * * @param data the SafeBag to add. * @return this builder. * @throws IOException */ public PKCS12PfxPduBuilder addData(PKCS12SafeBag data) throws IOException { dataVector.add(new ContentInfo(PKCSObjectIdentifiers.data, new DEROctetString(new DLSequence(data.toASN1Structure()).getEncoded()))); return this; }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); for (int i = 0; i != info.length; i++) { v.add(info[i]); } if (isBer) { return new BERSequence(v); } else { return new DLSequence(v); } } }
/** * return the ASN.1 encoded representation of this object. */ public byte[] getEncoded(String encoding) throws IOException { if (ASN1Encoding.DL.equals(encoding)) { return new DLSequence(new ASN1Encodable[] { resp.getStatus(), timeStampToken.toCMSSignedData().toASN1Structure() }).getEncoded(encoding); } return resp.getEncoded(encoding); } }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); for (int i = 0; i != info.length; i++) { v.add(info[i]); } if (isBer) { return new BERSequence(v); } else { return new DLSequence(v); } } }
/** * Add a set of SafeBags that are to be wrapped in a EncryptedData object. * * @param dataEncryptor the encryptor to use for encoding the data. * @param data the SafeBags to include. * @return this builder. * @throws IOException if a issue occurs processing the data. */ public PKCS12PfxPduBuilder addEncryptedData(OutputEncryptor dataEncryptor, PKCS12SafeBag[] data) throws IOException { ASN1EncodableVector v = new ASN1EncodableVector(); for (int i = 0; i != data.length; i++) { v.add(data[i].toASN1Structure()); } return addEncryptedData(dataEncryptor, new DLSequence(v)); }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(bagId); v.add(new DLTaggedObject(true, 0, bagValue)); if (bagAttributes != null) { v.add(bagAttributes); } return new DLSequence(v); } }
public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(bagId); v.add(new DLTaggedObject(true, 0, bagValue)); if (bagAttributes != null) { v.add(bagAttributes); } return new DLSequence(v); } }
/** * Add a set of SafeBags that are to be wrapped in a EncryptedData object. * * @param dataEncryptor the encryptor to use for encoding the data. * @param data the SafeBags to include. * @return this builder. * @throws IOException if a issue occurs processing the data. */ public PKCS12PfxPduBuilder addEncryptedData(OutputEncryptor dataEncryptor, PKCS12SafeBag[] data) throws IOException { ASN1EncodableVector v = new ASN1EncodableVector(); for (int i = 0; i != data.length; i++) { v.add(data[i].toASN1Structure()); } return addEncryptedData(dataEncryptor, new DLSequence(v)); }
/** * Produce an object suitable for an ASN1OutputStream. * <pre> * ContentInfo ::= SEQUENCE { * contentType ContentType, * content * [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL } * </pre> */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(contentType); if (content != null) { v.add(new BERTaggedObject(true, 0, content)); } if (isBer) { return new BERSequence(v); } else { return new DLSequence(v); } } }
/** * Produce an object suitable for an ASN1OutputStream. * <pre> * ContentInfo ::= SEQUENCE { * contentType ContentType, * content * [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL } * </pre> */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(contentType); if (content != null) { v.add(new BERTaggedObject(true, 0, content)); } if (isBer) { return new BERSequence(v); } else { return new DLSequence(v); } } }
return new DLSequence(obj.getObject());
return new DLSequence(obj.getObject());
throws PKCSException AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector)); byte[] encAuth;
throws PKCSException AuthenticatedSafe auth = AuthenticatedSafe.getInstance(new DLSequence(dataVector)); byte[] encAuth;
return new TimeStampResponse(new DLSequence(new ASN1Encodable[] { pkiStatusInfo.toASN1Primitive(), tstTokenContentInfo.toASN1Primitive() }));