Search in sources :

Example 81 with ASN1Primitive

use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.

the class ECGOST3410ParamSetParameters method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(6);
    v.add(a);
    v.add(b);
    v.add(p);
    v.add(q);
    v.add(x);
    v.add(y);
    return new DERSequence(v);
}
Also used : DERSequence(com.github.zhenwei.core.asn1.DERSequence) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector)

Example 82 with ASN1Primitive

use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.

the class EncryptedObjectStoreData method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(2);
    v.add(encryptionAlgorithm);
    v.add(encryptedContent);
    return new DERSequence(v);
}
Also used : DERSequence(com.github.zhenwei.core.asn1.DERSequence) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector)

Example 83 with ASN1Primitive

use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.

the class EncryptedPrivateKeyData method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(2);
    v.add(encryptedPrivateKeyInfo);
    v.add(new DERSequence(certificateChain));
    return new DERSequence(v);
}
Also used : DERSequence(com.github.zhenwei.core.asn1.DERSequence) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector)

Example 84 with ASN1Primitive

use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.

the class LinkedCertificate method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(4);
    v.add(digest);
    v.add(certLocation);
    if (certIssuer != null) {
        v.add(new DERTaggedObject(false, 0, certIssuer));
    }
    if (cACerts != null) {
        v.add(new DERTaggedObject(false, 1, cACerts));
    }
    return new DERSequence(v);
}
Also used : DERSequence(com.github.zhenwei.core.asn1.DERSequence) DERTaggedObject(com.github.zhenwei.core.asn1.DERTaggedObject) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector)

Example 85 with ASN1Primitive

use of com.github.zhenwei.core.asn1.ASN1Primitive in project LinLong-Java by zhenwei1108.

the class ObjectData method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(6);
    v.add(new ASN1Integer(type));
    v.add(new DERUTF8String(identifier));
    v.add(creationDate);
    v.add(lastModifiedDate);
    v.add(data);
    if (comment != null) {
        v.add(new DERUTF8String(comment));
    }
    return new DERSequence(v);
}
Also used : DERUTF8String(com.github.zhenwei.core.asn1.DERUTF8String) DERSequence(com.github.zhenwei.core.asn1.DERSequence) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector) ASN1Integer(com.github.zhenwei.core.asn1.ASN1Integer)

Aggregations

ASN1EncodableVector (com.github.zhenwei.core.asn1.ASN1EncodableVector)253 DERSequence (com.github.zhenwei.core.asn1.DERSequence)231 ASN1Primitive (org.bouncycastle.asn1.ASN1Primitive)177 IOException (java.io.IOException)107 ASN1InputStream (org.bouncycastle.asn1.ASN1InputStream)62 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)57 DERTaggedObject (com.github.zhenwei.core.asn1.DERTaggedObject)55 ASN1Integer (com.github.zhenwei.core.asn1.ASN1Integer)42 DEROctetString (com.github.zhenwei.core.asn1.DEROctetString)38 ByteArrayInputStream (java.io.ByteArrayInputStream)38 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)32 ASN1Primitive (com.github.zhenwei.core.asn1.ASN1Primitive)31 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)31 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)30 DEROctetString (org.bouncycastle.asn1.DEROctetString)28 BigInteger (java.math.BigInteger)24 GeneralSecurityException (java.security.GeneralSecurityException)24 X509Certificate (java.security.cert.X509Certificate)24 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)23 DERIA5String (org.bouncycastle.asn1.DERIA5String)22