use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.
the class ResponseData method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* ResponseData ::= SEQUENCE {
* version [0] EXPLICIT Version DEFAULT v1,
* responderID ResponderID,
* producedAt GeneralizedTime,
* responses SEQUENCE OF SingleResponse,
* responseExtensions [1] EXPLICIT Extensions OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(5);
if (versionPresent || !version.equals(V1)) {
v.add(new DERTaggedObject(true, 0, version));
}
v.add(responderID);
v.add(producedAt);
v.add(responses);
if (responseExtensions != null) {
v.add(new DERTaggedObject(true, 1, responseExtensions));
}
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.
the class SingleResponse method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SingleResponse ::= SEQUENCE {
* certID CertID,
* certStatus CertStatus,
* thisUpdate GeneralizedTime,
* nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
* singleExtensions [1] EXPLICIT Extensions OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(5);
v.add(certID);
v.add(certStatus);
v.add(thisUpdate);
if (nextUpdate != null) {
v.add(new DERTaggedObject(true, 0, nextUpdate));
}
if (singleExtensions != null) {
v.add(new DERTaggedObject(true, 1, singleExtensions));
}
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.
the class TBSRequest method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* TBSRequest ::= SEQUENCE {
* version [0] EXPLICIT Version DEFAULT v1,
* requestorName [1] EXPLICIT GeneralName OPTIONAL,
* requestList SEQUENCE OF Request,
* requestExtensions [2] EXPLICIT Extensions OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(4);
//
if (!version.equals(V1) || versionSet) {
v.add(new DERTaggedObject(true, 0, version));
}
if (requestorName != null) {
v.add(new DERTaggedObject(true, 1, requestorName));
}
v.add(requestList);
if (requestExtensions != null) {
v.add(new DERTaggedObject(true, 2, requestExtensions));
}
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.
the class ElGamalParameter method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(2);
v.add(p);
v.add(g);
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.
the class OCSPRequest method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* OCSPRequest ::= SEQUENCE {
* tbsRequest TBSRequest,
* optionalSignature [0] EXPLICIT Signature OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector(2);
v.add(tbsRequest);
if (optionalSignature != null) {
v.add(new DERTaggedObject(true, 0, optionalSignature));
}
return new DERSequence(v);
}
Aggregations