Example usage for org.bouncycastle.asn1 ASN1Integer ASN1Integer

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

Introduction

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

Prototype

public ASN1Integer(byte[] bytes) 

Source Link

Document

Construct an INTEGER from the passed in byte array.

Usage

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

License:Apache License

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

    v.add(new ASN1Integer(NAMED_PARAMETER_SET));
    v.add(new DERUTF8String(keyID));
    v.add(new ASN1Integer(algorithm.ordinal()));
    v.add(new DERUTF8String(domainParameters));
    v.add(new ASN1Integer(h));
    v.add(new ASN1Integer(threshold));
    v.add(toASN1Sequence(nodesToUse));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(sequenceNo));
    v.add(new DERUTF8String(name));

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(BigInteger.valueOf(operationNumber)));
    v.add(new DERUTF8String(boardName));
    v.add(new ASN1Integer(BigInteger.valueOf(stepNumber)));
    v.add(new DERUTF8String(transformName));

    if (keyID != null) {
        v.add(new DERUTF8String(keyID));
    }//from  w  w  w  .j a  va 2 s  .co  m

    v.add(new DERUTF8String(nodeName));

    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  ww . j ava2s  .c  o m

    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.SeedMessage.java

License:Apache License

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

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

    return new DERSequence(v);
}

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

License:Apache License

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

    v.add(new ASN1Integer(sequenceNo));
    v.add(shareData);/*  w w  w .  j a v  a2  s. co  m*/

    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.TranscriptBlock.java

License:Apache License

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

    v.add(new ASN1Integer(stepNo));
    v.add(details);//from   w  w  w.j a va 2 s .c  o m

    return new DERSequence(v);
}