List of usage examples for org.bouncycastle.asn1 DERSequence DERSequence
public DERSequence(ASN1Encodable[] elements)
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)); }/*w ww . j a v a2 s.co m*/ 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);/*from ww w .j a va2s . com*/ 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.KeyGenParams.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DERUTF8String(domainParameters)); 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);/*from ww w .ja v a 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 ww w . ja v a 2 s.com return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.MessageReply.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Enumerated(type.ordinal())); if (payload != null) { v.add(payload);//from w w w . j a va2 s . 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);/*from ww w .j a v a2 s. c o m*/ return new DERSequence(v); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.MessageWitnessBlock.java
License:Apache License
@Override public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); for (MessageWitness message : witnesses) { v.add(message);/* ww w . j a v a 2 s . c o m*/ } return new DERSequence(v); }
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.NamedKeyGenParams.java
License:Apache License
private static ASN1Sequence toASN1Sequence(List<String> set) { ASN1EncodableVector v = new ASN1EncodableVector(); for (String name : set) { v.add(new DERUTF8String(name)); }/*from w w w.j a v a2s .c o m*/ return new DERSequence(v); }