Example usage for org.bouncycastle.asn1 ASN1EncodableVector ASN1EncodableVector

List of usage examples for org.bouncycastle.asn1 ASN1EncodableVector ASN1EncodableVector

Introduction

In this page you can find the example usage for org.bouncycastle.asn1 ASN1EncodableVector ASN1EncodableVector.

Prototype

public ASN1EncodableVector() 

Source Link

Usage

From source file:org.jmrtd.lds.SignedDataUtil.java

License:Open Source License

public static void writeData(SignedData signedData, OutputStream outputStream) throws IOException {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(new ASN1ObjectIdentifier(SignedDataUtil.RFC_3369_SIGNED_DATA_OID));
    v.add(new DERTaggedObject(0, signedData));
    ASN1Sequence fileContentsObject = new DLSequence(v);
    byte[] fileContentsBytes = fileContentsObject.getEncoded(ASN1Encoding.DER);
    outputStream.write(fileContentsBytes);
}

From source file:org.jmrtd.lds.SignedDataUtil.java

License:Open Source License

public static ASN1Sequence createDigestAlgorithms(String digestAlgorithm) throws NoSuchAlgorithmException {
    ASN1ObjectIdentifier algorithmIdentifier = new ASN1ObjectIdentifier(
            SignedDataUtil.lookupOIDByMnemonic(digestAlgorithm));
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(algorithmIdentifier);//from   w  w w.ja  v  a 2  s  . com
    return new DLSequence(v);
}

From source file:org.jmrtd.lds.TerminalAuthenticationInfo.java

License:Open Source License

@Deprecated
public ASN1Primitive getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(new ASN1ObjectIdentifier(oid));
    v.add(new ASN1Integer(version));
    if (efCVCA != null) {
        v.add(efCVCA);/*from  ww w. j  a  v a 2 s.c  o  m*/
    }
    return new DLSequence(v);
}

From source file:org.jnotary.dvcs.Data.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    if (message != null)
        return message.toASN1Primitive();
    if (messageImprint != null)
        return messageImprint.toASN1Primitive();
    if (certs != null) {
        ASN1EncodableVector seq = new ASN1EncodableVector();
        for (int i = 0; i < certs.length; i++) {
            seq.add(certs[i]);// ww  w .  ja v a  2  s. c om
        }
        return new DERSequence(seq).toASN1Primitive();
    }
    return null;
}

From source file:org.jnotary.dvcs.DVCSCertInfo.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    if (version != null)
        v.add(version);/*from   w w  w. ja va 2  s  .  com*/
    v.add(dvReqInfo);
    v.add(messageImprint);
    v.add(serialNumber);
    v.add(responseTime);

    if (getDvStatus() != null)
        v.add(new DERTaggedObject(true, 0, getDvStatus()));
    if (getPolicy() != null)
        v.add(new DERTaggedObject(true, 1, getPolicy()));
    if (getReqSignature() != null)
        v.add(new DERTaggedObject(true, 2, getReqSignature()));
    if (getCerts() != null && getCerts().length > 0) {
        ASN1EncodableVector seq = new ASN1EncodableVector();
        for (int i = 0; i < getCerts().length; i++) {
            seq.add(getCerts()[i].toASN1Primitive());
        }
        v.add(new DERTaggedObject(true, 3, new DERSequence(seq)));
    }
    if (getExtensions() != null)
        v.add(getExtensions());

    return new DERSequence(v);
}

From source file:org.jnotary.dvcs.DVCSErrorNotice.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(transactionStatus);//from ww  w . j  a v  a  2 s . c om
    if (transactionIdentifier != null)
        v.add(transactionIdentifier);

    return new DERSequence(v);
}

From source file:org.jnotary.dvcs.DVCSRequest.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(requestInformation);/*from   w  w w  .ja v  a2s .com*/
    v.add(data);

    if (transactionIdentifier != null)
        v.add(transactionIdentifier);

    return new DERSequence(v);
}

From source file:org.jnotary.dvcs.DVCSRequestInformation.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    if (version != null)
        v.add(version);/*  w w w.  j a v a 2  s .  c o m*/
    v.add(service);

    if (nonce != null)
        v.add(nonce);
    if (requestTime != null)
        v.add(requestTime);
    if (requester != null)
        v.add(new DERTaggedObject(true, 0, requester));
    if (requestPolicy != null)
        v.add(new DERTaggedObject(true, 1, requestPolicy));
    if (dvcs != null)
        v.add(new DERTaggedObject(true, 2, dvcs));
    if (dataLocations != null)
        v.add(new DERTaggedObject(true, 3, dataLocations));
    if (extensions != null)
        v.add(new DERTaggedObject(false, 4, extensions));

    return new DERSequence(v);
}

From source file:org.jnotary.dvcs.PathProcInput.java

License:Open Source License

@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    ASN1EncodableVector seq = new ASN1EncodableVector();
    for (int i = 0; i < acceptablePolicySet.length; i++) {
        seq.add(acceptablePolicySet[i].toASN1Primitive());
    }//from w ww .ja  va 2s . co m
    v.add(new DERSequence(seq));

    v.add(inhibitPolicyMapping);
    v.add(explicitPolicyReqd);

    return new DERSequence(v);
}