Example usage for org.bouncycastle.asn1 DEROctetString DEROctetString

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

Introduction

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

Prototype

public DEROctetString(ASN1Encodable obj) throws IOException 

Source Link

Document

Constructor from the encoding of an ASN.1 object.

Usage

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

License:Apache License

@Override
public ASN1Primitive toASN1Primitive() {
    return new DEROctetString(value.toBytes());
}

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

License:Apache License

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

    v.add(new DERUTF8String(fileName));

    if (chunk != null) {
        v.add(new DEROctetString(chunk));
    }/*ww  w  .j  a v  a  2  s.  co  m*/

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(newIndex));
    v.add(new DEROctetString(secret));

    if (detail != null) {
        v.add(new DEROctetString(detail));
    }//ww  w  . j  ava  2 s  .  com

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(index));
    v.add(new DEROctetString(data));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(index));
    v.add(new DEROctetString(message));

    if (commitment != null) {
        v.add(new DEROctetString(commitment));
    }/*from   w w  w .ja  v a 2 s.  c  o  m*/

    return new DERSequence(v);
}

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

License:Apache License

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

    for (byte[] message : messages) {
        v.add(new DEROctetString(message));
    }//from   w w  w.j  ava 2  s. co  m

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new DEROctetString(seed));
    v.add(new DEROctetString(witness));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Integer(operationNumber));
    v.add(new DEROctetString(commitment));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new DERUTF8String(keyID));
    v.add(new ASN1Integer(threshold));
    v.add(new DEROctetString(message));
    v.add(MessageUtils.toASN1Sequence(nodesToUse));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(queryID));
    v.add(new ASN1Integer(operationNumber));
    v.add(new ASN1Integer(stepNo));
    v.add(new ASN1Integer(type.ordinal()));
    v.add(new ASN1Integer(maxNumberOfMessages));
    v.add(ASN1Boolean.getInstance(withPairing));

    if (seed != null) {
        v.add(new DEROctetString(seed));
    }//from  w  w w. jav a2s  . c  o  m

    return new DERSequence(v);
}