use of org.gudy.bouncycastle.asn1.ASN1EncodableVector in project robovm by robovm.
the class X509Name method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
if (seq == null) {
ASN1EncodableVector vec = new ASN1EncodableVector();
ASN1EncodableVector sVec = new ASN1EncodableVector();
ASN1ObjectIdentifier lstOid = null;
for (int i = 0; i != ordering.size(); i++) {
ASN1EncodableVector v = new ASN1EncodableVector();
ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) ordering.elementAt(i);
v.add(oid);
String str = (String) values.elementAt(i);
v.add(converter.getConvertedValue(oid, str));
if (lstOid == null || ((Boolean) this.added.elementAt(i)).booleanValue()) {
sVec.add(new DERSequence(v));
} else {
vec.add(new DERSet(sVec));
sVec = new ASN1EncodableVector();
sVec.add(new DERSequence(v));
}
lstOid = oid;
}
vec.add(new DERSet(sVec));
seq = new DERSequence(vec);
}
return seq;
}
use of org.gudy.bouncycastle.asn1.ASN1EncodableVector in project robovm by robovm.
the class AttributeTypeAndValue method toASN1Primitive.
/**
* <pre>
* AttributeTypeAndValue ::= SEQUENCE {
* type OBJECT IDENTIFIER,
* value ANY DEFINED BY type }
* </pre>
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(type);
v.add(value);
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.ASN1EncodableVector in project robovm by robovm.
the class AlgorithmIdentifier method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(objectId);
if (parametersDefined) {
if (parameters != null) {
v.add(parameters);
} else {
v.add(DERNull.INSTANCE);
}
}
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.ASN1EncodableVector in project robovm by robovm.
the class AttCertValidityPeriod method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* AttCertValidityPeriod ::= SEQUENCE {
* notBeforeTime GeneralizedTime,
* notAfterTime GeneralizedTime
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(notBeforeTime);
v.add(notAfterTime);
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.ASN1EncodableVector in project robovm by robovm.
the class AttributeCertificate method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* AttributeCertificate ::= SEQUENCE {
* acinfo AttributeCertificateInfo,
* signatureAlgorithm AlgorithmIdentifier,
* signatureValue BIT STRING
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(acinfo);
v.add(signatureAlgorithm);
v.add(signatureValue);
return new DERSequence(v);
}
Aggregations