use of com.android.hotspot2.asn1.Asn1Integer in project robovm by robovm.
the class EncryptedData method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new ASN1Integer(0));
v.add(data);
return new BERSequence(v);
}
use of com.android.hotspot2.asn1.Asn1Integer in project robovm by robovm.
the class MacData method toASN1Primitive.
/**
* <pre>
* MacData ::= SEQUENCE {
* mac DigestInfo,
* macSalt OCTET STRING,
* iterations INTEGER DEFAULT 1
* -- Note: The default is for historic reasons and its use is deprecated. A
* -- higher value, like 1024 is recommended.
* </pre>
* @return the basic ASN1Primitive construction.
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(digInfo);
v.add(new DEROctetString(salt));
if (!iterationCount.equals(ONE)) {
v.add(new ASN1Integer(iterationCount));
}
return new DERSequence(v);
}
use of com.android.hotspot2.asn1.Asn1Integer in project robovm by robovm.
the class Pfx method toASN1Primitive.
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new ASN1Integer(3));
v.add(contentInfo);
if (macData != null) {
v.add(macData);
}
return new BERSequence(v);
}
use of com.android.hotspot2.asn1.Asn1Integer in project robovm by robovm.
the class PrivateKeyInfo method toASN1Primitive.
/**
* write out an RSA private key with its associated information
* as described in PKCS8.
* <pre>
* PrivateKeyInfo ::= SEQUENCE {
* version Version,
* privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
* privateKey PrivateKey,
* attributes [0] IMPLICIT Attributes OPTIONAL
* }
* Version ::= INTEGER {v1(0)} (v1,...)
*
* PrivateKey ::= OCTET STRING
*
* Attributes ::= SET OF Attribute
* </pre>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new ASN1Integer(0));
v.add(algId);
v.add(privKey);
if (attributes != null) {
v.add(new DERTaggedObject(false, 0, attributes));
}
return new DERSequence(v);
}
use of com.android.hotspot2.asn1.Asn1Integer in project robovm by robovm.
the class RSAPublicKey method toASN1Primitive.
/**
* This outputs the key in PKCS1v2 format.
* <pre>
* RSAPublicKey ::= SEQUENCE {
* modulus INTEGER, -- n
* publicExponent INTEGER, -- e
* }
* </pre>
* <p>
*/
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new ASN1Integer(getModulus()));
v.add(new ASN1Integer(getPublicExponent()));
return new DERSequence(v);
}
Aggregations