Example usage for org.bouncycastle.asn1 DERSequence DERSequence

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

Introduction

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

Prototype

public DERSequence(ASN1Encodable[] elements) 

Source Link

Document

Create a sequence containing an array of objects.

Usage

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

License:Apache License

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

    v.add(new ASN1Enumerated(algorithm.ordinal()));
    v.add(payload);//from  ww  w . java2 s .co m

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(MessageUtils.toASN1Set(transformNames));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(new DERUTF8String(host));
    v.add(new ASN1Integer(messageCount));

    if (backupHost != null) {
        v.add(new DERUTF8String(backupHost));
    }//from www.  ja v  a2s  .c o m

    return new DERSequence(v);
}

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

License:Apache License

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

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

    return new DERSequence(v);
}

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);/*  w  ww .j  av  a2s  .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]));
    }//w ww . ja  v  a  2 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]));
    }/* w  w  w. j av a 2  s.  c o  m*/

    v.add(new DERSequence(dataV));

    return new DERSequence(v);
}