use of org.gudy.bouncycastle.asn1.DERSequence in project XobotOS by xamarin.
the class SubjectPublicKeyInfo method toASN1Object.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SubjectPublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* publicKey BIT STRING }
* </pre>
*/
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(algId);
v.add(keyData);
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.DERSequence in project XobotOS by xamarin.
the class AttributeTypeAndValue method toASN1Object.
/**
* <pre>
* AttributeTypeAndValue ::= SEQUENCE {
* type OBJECT IDENTIFIER,
* value ANY DEFINED BY type }
* </pre>
* @return a basic ASN.1 object representation.
*/
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(type);
v.add(value);
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.DERSequence in project XobotOS by xamarin.
the class AlgorithmIdentifier method toASN1Object.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL }
* </pre>
*/
public DERObject toASN1Object() {
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.DERSequence in project XobotOS by xamarin.
the class GeneralSubtree method toASN1Object.
/**
* Produce an object suitable for an ASN1OutputStream.
*
* Returns:
*
* <pre>
* GeneralSubtree ::= SEQUENCE
* {
* base GeneralName,
* minimum [0] BaseDistance DEFAULT 0,
* maximum [1] BaseDistance OPTIONAL
* }
* </pre>
*
* @return a DERObject
*/
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(base);
if (minimum != null && !minimum.getValue().equals(ZERO)) {
v.add(new DERTaggedObject(false, 0, minimum));
}
if (maximum != null) {
v.add(new DERTaggedObject(false, 1, maximum));
}
return new DERSequence(v);
}
use of org.gudy.bouncycastle.asn1.DERSequence in project XobotOS by xamarin.
the class ObjectDigestInfo method toASN1Object.
/**
* Produce an object suitable for an ASN1OutputStream.
*
* <pre>
*
* ObjectDigestInfo ::= SEQUENCE {
* digestedObjectType ENUMERATED {
* publicKey (0),
* publicKeyCert (1),
* otherObjectTypes (2) },
* -- otherObjectTypes MUST NOT
* -- be used in this profile
* otherObjectTypeID OBJECT IDENTIFIER OPTIONAL,
* digestAlgorithm AlgorithmIdentifier,
* objectDigest BIT STRING
* }
*
* </pre>
*/
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(digestedObjectType);
if (otherObjectTypeID != null) {
v.add(otherObjectTypeID);
}
v.add(digestAlgorithm);
v.add(objectDigest);
return new DERSequence(v);
}
Aggregations