Produce an object suitable for an ASN1OutputStream.
TBSRequest ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
requestorName [1] EXPLICIT GeneralName OPTIONAL,
requestList SEQUENCE OF Request,
requestExtensions [2] EXPLICIT Extensions OPTIONAL }
ASN1EncodableVector v = new ASN1EncodableVector();
//
// if default don't include.
//
if (!version.equals(V1))
{
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);