use of org.bouncycastle.asn1.ASN1Primitive in project robovm by robovm.
the class AttributeTypeAndValue method toASN1Primitive.
/**
* <pre>
* AttributeTypeAndValue ::= SEQUENCE {
* type OBJECT IDENTIFIER,
* value ANY DEFINED BY type }
* </pre>
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(type);
v.add(value);
return new DERSequence(v);
}
use of org.bouncycastle.asn1.ASN1Primitive in project robovm by robovm.
the class IETFUtils method canonicalize.
public static String canonicalize(String s) {
String value = Strings.toLowerCase(s.trim());
if (value.length() > 0 && value.charAt(0) == '#') {
ASN1Primitive obj = decodeObject(value);
if (obj instanceof ASN1String) {
value = Strings.toLowerCase(((ASN1String) obj).getString().trim());
}
}
value = stripInternalSpaces(value);
return value;
}
use of org.bouncycastle.asn1.ASN1Primitive 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 org.bouncycastle.asn1.ASN1Primitive 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 org.bouncycastle.asn1.ASN1Primitive 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);
}
Aggregations