public EnvelopedData( OriginatorInfo originatorInfo, ASN1Set recipientInfos, EncryptedContentInfo encryptedContentInfo, Attributes unprotectedAttrs) { version = new ASN1Integer(calculateVersion(originatorInfo, recipientInfos, ASN1Set.getInstance(unprotectedAttrs))); this.originatorInfo = originatorInfo; this.recipientInfos = recipientInfos; this.encryptedContentInfo = encryptedContentInfo; this.unprotectedAttrs = ASN1Set.getInstance(unprotectedAttrs); }
public EnvelopedData( OriginatorInfo originatorInfo, ASN1Set recipientInfos, EncryptedContentInfo encryptedContentInfo, Attributes unprotectedAttrs) { version = new ASN1Integer(calculateVersion(originatorInfo, recipientInfos, ASN1Set.getInstance(unprotectedAttrs))); this.originatorInfo = originatorInfo; this.recipientInfos = recipientInfos; this.encryptedContentInfo = encryptedContentInfo; this.unprotectedAttrs = ASN1Set.getInstance(unprotectedAttrs); }
public AttributeTable( Attributes attrs) { this(ASN1Set.getInstance(attrs.toASN1Primitive())); }
public static Attributes getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Set.getInstance(obj, explicit)); }
public AttributeTable( Attributes attrs) { this(ASN1Set.getInstance(attrs.toASN1Primitive())); }
public static RDN getInstance(Object obj) { if (obj instanceof RDN) { return (RDN)obj; } else if (obj != null) { return new RDN(ASN1Set.getInstance(obj)); } return null; }
public static RDN getInstance(Object obj) { if (obj instanceof RDN) { return (RDN)obj; } else if (obj != null) { return new RDN(ASN1Set.getInstance(obj)); } return null; }
public DistributionPointName( ASN1TaggedObject obj) { this.type = obj.getTagNo(); if (type == 0) { this.name = GeneralNames.getInstance(obj, false); } else { this.name = ASN1Set.getInstance(obj, false); } }
public DistributionPointName( ASN1TaggedObject obj) { this.type = obj.getTagNo(); if (type == 0) { this.name = GeneralNames.getInstance(obj, false); } else { this.name = ASN1Set.getInstance(obj, false); } }
/** * @deprecated use PrivateKeyInfo.getInstance() * @param seq */ public PrivateKeyInfo( ASN1Sequence seq) { Enumeration e = seq.getObjects(); BigInteger version = ((ASN1Integer)e.nextElement()).getValue(); if (version.intValue() != 0) { throw new IllegalArgumentException("wrong version for private key info"); } algId = AlgorithmIdentifier.getInstance(e.nextElement()); privKey = ASN1OctetString.getInstance(e.nextElement()); if (e.hasMoreElements()) { attributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false); } }
private String getVeriSignNonVerified(byte[] octets) throws IOException { /* NonVerified ::= SET OF ATTRIBUTE */ StringBuilder sb = new StringBuilder(); ASN1Set asn1Set = ASN1Set.getInstance(octets); for (ASN1Encodable attribute : asn1Set.toArray()) { ASN1ObjectIdentifier attributeId = ((Attribute) attribute).getAttrType(); ASN1Set attributeValues = ((Attribute) attribute).getAttrValues(); for (ASN1Encodable attributeValue : attributeValues.toArray()) { String attributeValueStr = getAttributeValueString(attributeId, attributeValue); sb.append(MessageFormat.format("{0}={1}", attributeId.getId(), attributeValueStr)); sb.append(NEWLINE); } } return sb.toString(); } }
private Attribute( ASN1Sequence seq) { if (seq.size() != 2) { throw new IllegalArgumentException("Bad sequence size: " + seq.size()); } attrType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0)); attrValues = ASN1Set.getInstance(seq.getObjectAt(1)); }
private Attribute( ASN1Sequence seq) { if (seq.size() != 2) { throw new IllegalArgumentException("Bad sequence size: " + seq.size()); } attrType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0)); attrValues = ASN1Set.getInstance(seq.getObjectAt(1)); }
private TaggedAttribute(ASN1Sequence seq) { if (seq.size() != 3) { throw new IllegalArgumentException("incorrect sequence size"); } this.bodyPartID = BodyPartID.getInstance(seq.getObjectAt(0)); this.attrType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1)); this.attrValues = ASN1Set.getInstance(seq.getObjectAt(2)); }
/** * @deprecated use getInstance() */ public EnvelopedData( ASN1Sequence seq) { int index = 0; version = (ASN1Integer)seq.getObjectAt(index++); Object tmp = seq.getObjectAt(index++); if (tmp instanceof ASN1TaggedObject) { originatorInfo = OriginatorInfo.getInstance((ASN1TaggedObject)tmp, false); tmp = seq.getObjectAt(index++); } recipientInfos = ASN1Set.getInstance(tmp); encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(index++)); if(seq.size() > index) { unprotectedAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(index), false); } }
private EncryptedData(ASN1Sequence seq) { this.version = ASN1Integer.getInstance(seq.getObjectAt(0)); this.encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(1)); if (seq.size() == 3) { this.unprotectedAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(2), false); } }
private EncryptedData(ASN1Sequence seq) { this.version = ASN1Integer.getInstance(seq.getObjectAt(0)); this.encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(1)); if (seq.size() == 3) { this.unprotectedAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(2), false); } }
private CertificationRequestInfo( ASN1Sequence seq) { if (seq.size() != 4) { throw new IllegalArgumentException("incorrect sequence size for CertificationRequestInfo"); } version = ASN1Integer.getInstance(seq.getObjectAt(0)); subject = X500Name.getInstance(seq.getObjectAt(1)); subjectPublicKeyInfo = ASN1Sequence.getInstance(seq.getObjectAt(2)); if (subjectPublicKeyInfo.size() != 2) { throw new IllegalArgumentException("incorrect subjectPublicKeyInfo size for CertificationRequestInfo"); } ASN1TaggedObject tagobj = (ASN1TaggedObject)seq.getObjectAt(3); if (tagobj.getTagNo() != 0) { throw new IllegalArgumentException("incorrect tag number on attributes for CertificationRequestInfo"); } attributes = ASN1Set.getInstance(tagobj, false); }
public byte[] getEncoded() { try { ASN1Set attrSet = ASN1Set.getInstance(attributes); PrivateKeyInfo privInfo = PrivateKeyInfoFactory.createPrivateKeyInfo(eddsaPrivateKey, attrSet); if (hasPublicKey) { return privInfo.getEncoded(); } else { return new PrivateKeyInfo(privInfo.getPrivateKeyAlgorithm(), privInfo.parsePrivateKey(), attrSet).getEncoded(); } } catch (IOException e) { return null; } }
public byte[] getEncoded() { try { ASN1Set attrSet = ASN1Set.getInstance(attributes); PrivateKeyInfo privInfo = PrivateKeyInfoFactory.createPrivateKeyInfo(xdhPrivateKey, attrSet); if (hasPublicKey) { return privInfo.getEncoded(); } else { return new PrivateKeyInfo(privInfo.getPrivateKeyAlgorithm(), privInfo.parsePrivateKey(), attrSet).getEncoded(); } } catch (IOException e) { return null; } }