use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class SubjectPublicKeyInfo method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SubjectPublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* publicKey BIT STRING }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(algId);
v.add(keyData);
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class TBSCertList method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
if (version != null) {
v.add(version);
}
v.add(signature);
v.add(issuer);
v.add(thisUpdate);
if (nextUpdate != null) {
v.add(nextUpdate);
}
// Add CRLEntries if they exist
if (revokedCertificates != null) {
v.add(revokedCertificates);
}
if (crlExtensions != null) {
v.add(new DERTaggedObject(0, crlExtensions));
}
return new DERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class AttributeTable method getAll.
/**
* Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be
* empty if there are no attributes of the required type present.
*
* @param oid type of attribute required.
* @return a vector of all the attributes found of type oid.
*/
public ASN1EncodableVector getAll(ASN1ObjectIdentifier oid) {
ASN1EncodableVector v = new ASN1EncodableVector();
Object value = attributes.get(oid);
if (value instanceof Vector) {
Enumeration e = ((Vector) value).elements();
while (e.hasMoreElements()) {
v.add((Attribute) e.nextElement());
}
} else if (value != null) {
v.add((Attribute) value);
}
return v;
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class ContentInfo method toASN1Primitive.
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* ContentInfo ::= SEQUENCE {
* contentType ContentType,
* content
* [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
if (content != null) {
v.add(new BERTaggedObject(0, content));
}
return new BERSequence(v);
}
use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.
the class IssuerAndSerialNumber method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(name);
v.add(serialNumber);
return new DERSequence(v);
}
Aggregations