Example usage for org.bouncycastle.asn1 ASN1EncodableVector add

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

Introduction

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

Prototype

public void add(ASN1Encodable element) 

Source Link

Usage

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardErrorStatusMessage.java

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Enumerated(status.ordinal()));

    return new DERTaggedObject(true, 1, new DERSequence(v));
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardMessage.java

License:Apache License

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

    v.add(new DERUTF8String(boardName));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardStatusMessage.java

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Enumerated(status.ordinal()));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardUploadBlockMessage.java

License:Apache License

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

    v.add(new ASN1Integer(operationNumber));
    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Integer(stepNumber));
    v.add(messageBlock);//from   ww  w .  j a  va 2s  .  c  o  m

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardUploadIndexedMessage.java

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Integer(index));

    ASN1EncodableVector dataV = new ASN1EncodableVector();

    for (int i = 0; i != data.length; i++) {
        dataV.add(new DEROctetString(data[i]));
    }//from   w w  w  .  ja  va2 s .  c  o  m

    v.add(new DERSequence(dataV));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.BoardUploadMessage.java

License:Apache License

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

    v.add(new DERUTF8String(boardName));

    ASN1EncodableVector dataV = new ASN1EncodableVector();

    for (int i = 0; i != data.length; i++) {
        dataV.add(new DEROctetString(data[i]));
    }//from   www.  j  a  v  a 2 s  . c om

    v.add(new DERSequence(dataV));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.CapabilityMessage.java

License:Apache License

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

    v.add(new ASN1Enumerated(type.ordinal()));
    v.add(new DERSet(details));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.ChallengeLogMessage.java

License:Apache License

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

    v.add(new ASN1Integer(index));
    v.add(new ASN1Integer(sequenceNo));
    v.add(ASN1Boolean.getInstance(hasPassed));
    v.add(keyInfo);/* w ww .j a  v  a2s . c o  m*/
    v.add(new PointSequence(sourceMessage));

    ASN1EncodableVector dv = new ASN1EncodableVector();
    for (ECDecryptionProof proof : decryptionProofs) {
        ASN1EncodableVector proofV = new ASN1EncodableVector();

        proofV.add(new DEROctetString(proof.getA().getEncoded(true)));
        proofV.add(new DEROctetString(proof.getB().getEncoded(true)));
        proofV.add(new ASN1Integer(proof.getR()));

        dv.add(new DERSequence(proofV));
    }

    v.add(new DERSequence(dv));

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.ClientMessage.java

License:Apache License

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

    v.add(CLIENT_LEVEL);
    v.add(new ASN1Enumerated(type.ordinal()));
    v.add(payload);/*from  w  ww  . ja v  a2s .com*/

    return new DERSequence(v);
}

From source file:org.cryptoworkshop.ximix.common.asn1.message.CommandMessage.java

License:Apache License

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

    v.add(COMMAND_LEVEL);
    v.add(new ASN1Enumerated(type.ordinal()));
    v.add(payload);/*  www.ja  va  2s  .  c o m*/

    return new DERSequence(v);
}