Search in sources :

Example 1 with DLTaggedObject

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

the class SafeBag method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(bagId);
    v.add(new DLTaggedObject(true, 0, bagValue));
    if (bagAttributes != null) {
        v.add(bagAttributes);
    }
    return new DLSequence(v);
}
Also used : DLTaggedObject(org.bouncycastle.asn1.DLTaggedObject) DLSequence(org.bouncycastle.asn1.DLSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 2 with DLTaggedObject

use of com.github.zhenwei.core.asn1.DLTaggedObject in project jmulticard by ctt-gob-es.

the class ContentInfo method toASN1Primitive.

/**
 * Produce an object suitable for an ASN1OutputStream.
 */
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(2);
    v.add(contentType);
    if (content != null) {
        if (isDefiniteLength) {
            v.add(new DLTaggedObject(0, content));
        } else {
            v.add(new BERTaggedObject(0, content));
        }
    }
    return isDefiniteLength ? (ASN1Primitive) new DLSequence(v) : (ASN1Primitive) new BERSequence(v);
}
Also used : DLTaggedObject(org.bouncycastle.asn1.DLTaggedObject) DLSequence(org.bouncycastle.asn1.DLSequence) BERSequence(org.bouncycastle.asn1.BERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector) BERTaggedObject(org.bouncycastle.asn1.BERTaggedObject)

Example 3 with DLTaggedObject

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

the class SafeBag method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector(3);
    v.add(bagId);
    v.add(new DLTaggedObject(true, 0, bagValue));
    if (bagAttributes != null) {
        v.add(bagAttributes);
    }
    return new DLSequence(v);
}
Also used : DLTaggedObject(com.github.zhenwei.core.asn1.DLTaggedObject) DLSequence(com.github.zhenwei.core.asn1.DLSequence) ASN1EncodableVector(com.github.zhenwei.core.asn1.ASN1EncodableVector)

Aggregations

ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)2 DLSequence (org.bouncycastle.asn1.DLSequence)2 DLTaggedObject (org.bouncycastle.asn1.DLTaggedObject)2 ASN1EncodableVector (com.github.zhenwei.core.asn1.ASN1EncodableVector)1 DLSequence (com.github.zhenwei.core.asn1.DLSequence)1 DLTaggedObject (com.github.zhenwei.core.asn1.DLTaggedObject)1 BERSequence (org.bouncycastle.asn1.BERSequence)1 BERTaggedObject (org.bouncycastle.asn1.BERTaggedObject)1