List of usage examples for org.bouncycastle.asn1 ASN1Integer ASN1Integer
public ASN1Integer(byte[] bytes)
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.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 va2 s . c om*/ 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 w w. j a 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.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);//from ww w . j a v a 2 s .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.CopyAndMoveMessage.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(nodeName)); return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.DownloadShuffledBoardMessage.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DERUTF8String(keyID)); v.add(new DERUTF8String(boardName)); v.add(new ASN1Integer(blockSize)); return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.KeyGenerationMessage.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Enumerated(algorithm.ordinal())); v.add(new DERUTF8String(keyID)); v.add(keyGenParameters);//w ww. j a v a 2 s . c o m v.add(new ASN1Integer(threshold)); v.add(toASN1Sequence(nodesToUse)); // TODO: should be sequence? return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.KeyPairGenerateMessage.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Integer(algorithm.ordinal())); v.add(new ASN1Integer(type.ordinal())); v.add(payload);// w w w .j ava 2s. c o 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)); }/*from w ww. j a va2s.c o m*/ return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.MessageWitness.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Integer(index)); v.add(witness);//w w w. ja v a 2 s .c o m return new DERSequence(v); }