use of org.bouncycastle.asn1.DEROctetString in project XobotOS by xamarin.
the class MacData method toASN1Object.
/**
* <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 DERObject construction.
*/
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(digInfo);
v.add(new DEROctetString(salt));
if (!iterationCount.equals(ONE)) {
v.add(new DERInteger(iterationCount));
}
return new DERSequence(v);
}
use of org.bouncycastle.asn1.DEROctetString in project XobotOS by xamarin.
the class PrivateKeyInfo method toASN1Object.
/**
* 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 DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(new DERInteger(0));
v.add(algId);
v.add(new DEROctetString(privKey));
if (attributes != null) {
v.add(new DERTaggedObject(false, 0, attributes));
}
return new DERSequence(v);
}
use of org.bouncycastle.asn1.DEROctetString in project XobotOS by xamarin.
the class DigestInfo method toASN1Object.
public DERObject toASN1Object() {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(algId);
v.add(new DEROctetString(digest));
return new DERSequence(v);
}
Aggregations