Search in sources :

Example 76 with ASN1EncodableVector

use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.

the class EncryptedPrivateKeyInfo method toASN1Primitive.

/**
     * Produce an object suitable for an ASN1OutputStream.
     * <pre>
     * EncryptedPrivateKeyInfo ::= SEQUENCE {
     *      encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
     *      encryptedData EncryptedData
     * }
     *
     * EncryptedData ::= OCTET STRING
     *
     * KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
     *          ... -- For local profiles
     * }
     * </pre>
     */
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(algId);
    v.add(data);
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 77 with ASN1EncodableVector

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(certSerialNumber);
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 78 with ASN1EncodableVector

use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.

the class PBES2Algorithms method getASN1Primitive.

public ASN1Primitive getASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    ASN1EncodableVector subV = new ASN1EncodableVector();
    v.add(objectId);
    subV.add(func);
    subV.add(scheme);
    v.add(new DERSequence(subV));
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 79 with ASN1EncodableVector

use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.

the class PBKDF2Params method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(octStr);
    v.add(iterationCount);
    if (keyLength != null) {
        v.add(keyLength);
    }
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 80 with ASN1EncodableVector

use of com.github.zhenwei.core.asn1.ASN1EncodableVector in project robovm by robovm.

the class PKCS12PBEParams method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(iv);
    v.add(iterations);
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Aggregations

ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)391 ASN1EncodableVector (com.github.zhenwei.core.asn1.ASN1EncodableVector)330 DERSequence (org.bouncycastle.asn1.DERSequence)318 DERSequence (com.github.zhenwei.core.asn1.DERSequence)286 IOException (java.io.IOException)104 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)91 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)70 DEROctetString (org.bouncycastle.asn1.DEROctetString)70 DERTaggedObject (com.github.zhenwei.core.asn1.DERTaggedObject)68 DERTaggedObject (org.bouncycastle.asn1.DERTaggedObject)57 ASN1Integer (com.github.zhenwei.core.asn1.ASN1Integer)49 DEROctetString (com.github.zhenwei.core.asn1.DEROctetString)49 X509Certificate (java.security.cert.X509Certificate)40 BigInteger (java.math.BigInteger)38 DERBitString (org.bouncycastle.asn1.DERBitString)35 DERSet (org.bouncycastle.asn1.DERSet)34 Enumeration (java.util.Enumeration)31 ArrayList (java.util.ArrayList)30 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)28 Iterator (java.util.Iterator)26