use of com.github.zhenwei.core.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 com.github.zhenwei.core.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 com.github.zhenwei.core.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);
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class DHDomainParameters method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(this.p);
v.add(this.g);
v.add(this.q);
if (this.j != null) {
v.add(this.j);
}
if (this.validationParms != null) {
v.add(this.validationParms);
}
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class X9Curve method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* Curve ::= SEQUENCE {
* a FieldElement,
* b FieldElement,
* seed BIT STRING OPTIONAL
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
if (fieldIdentifier.equals(prime_field)) {
v.add(new X9FieldElement(curve.getA()).toASN1Primitive());
v.add(new X9FieldElement(curve.getB()).toASN1Primitive());
} else if (fieldIdentifier.equals(characteristic_two_field)) {
v.add(new X9FieldElement(curve.getA()).toASN1Primitive());
v.add(new X9FieldElement(curve.getB()).toASN1Primitive());
}
if (seed != null) {
v.add(new DERBitString(seed));
}
return new DERSequence(v);
}
Aggregations