List of usage examples for org.bouncycastle.asn1 ASN1Integer getInstance
public static ASN1Integer getInstance(Object obj)
From source file:org.cryptoworkshop.ximix.common.asn1.message.KeyPairGenerateMessage.java
License:Apache License
private KeyPairGenerateMessage(Enum[] types, ASN1Sequence seq) { this.algorithm = Algorithm.values()[ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue()]; this.type = types[ASN1Integer.getInstance(seq.getObjectAt(1)).getValue().intValue()]; this.payload = seq.getObjectAt(2); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.MessageCommitment.java
License:Apache License
private MessageCommitment(ASN1Sequence seq) { this.newIndex = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue(); this.secret = ASN1OctetString.getInstance(seq.getObjectAt(1)).getOctets(); if (seq.size() > 2) { this.detail = ASN1OctetString.getInstance(seq.getObjectAt(2)).getOctets(); } else {//from w ww. j a v a 2 s .c om this.detail = null; } }
From source file:org.cryptoworkshop.ximix.common.asn1.message.MessageWitness.java
License:Apache License
private MessageWitness(ASN1Sequence seq) { this.index = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue(); this.witness = MessageCommitment.getInstance(seq.getObjectAt(1)); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.NamedKeyGenParams.java
License:Apache License
NamedKeyGenParams(ASN1Sequence seq) { super(NAMED_PARAMETER_SET); this.keyID = DERUTF8String.getInstance(seq.getObjectAt(1)).getString(); this.algorithm = Algorithm.values()[ASN1Integer.getInstance(seq.getObjectAt(2)).getValue().intValue()]; this.domainParameters = DERUTF8String.getInstance(seq.getObjectAt(3)).getString(); this.h = ASN1Integer.getInstance(seq.getObjectAt(4)).getValue(); this.threshold = ASN1Integer.getInstance(seq.getObjectAt(5)).getValue().intValue(); this.nodesToUse = toList(ASN1Sequence.getInstance(seq.getObjectAt(6))); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.ParticipantMessage.java
License:Apache License
private ParticipantMessage(ASN1Sequence seq) { this.sequenceNo = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue(); this.name = DERUTF8String.getInstance(seq.getObjectAt(1)).getString(); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.PermuteAndMoveMessage.java
License:Apache License
private PermuteAndMoveMessage(ASN1Sequence seq) { this.operationNumber = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().longValue(); this.boardName = DERUTF8String.getInstance(seq.getObjectAt(1)).getString(); this.stepNumber = ASN1Integer.getInstance(seq.getObjectAt(2)).getValue().intValue(); this.transformName = DERUTF8String.getInstance(seq.getObjectAt(3)).getString(); if (seq.size() == 6) { this.keyID = DERUTF8String.getInstance(seq.getObjectAt(4)).getString(); this.nodeName = DERUTF8String.getInstance(seq.getObjectAt(5)).getString(); } else {/*from w w w . j ava 2 s . co m*/ this.keyID = null; this.nodeName = DERUTF8String.getInstance(seq.getObjectAt(4)).getString(); } }
From source file:org.cryptoworkshop.ximix.common.asn1.message.PostedData.java
License:Apache License
private PostedData(ASN1Sequence seq) { this.index = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue(); this.data = ASN1OctetString.getInstance(seq.getObjectAt(1)).getOctets(); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.PostedMessage.java
License:Apache License
private PostedMessage(ASN1Sequence seq) { this.index = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue(); this.message = ASN1OctetString.getInstance(seq.getObjectAt(1)).getOctets(); if (seq.size() == 3) { this.commitment = ASN1OctetString.getInstance(seq.getObjectAt(2)).getOctets(); } else {/*from w w w .j ava 2 s . co m*/ this.commitment = null; } }
From source file:org.cryptoworkshop.ximix.common.asn1.message.SeedCommitmentMessage.java
License:Apache License
private SeedCommitmentMessage(ASN1Sequence sequence) { this.boardName = DERUTF8String.getInstance(sequence.getObjectAt(0)).getString(); this.operationNumber = ASN1Integer.getInstance(sequence.getObjectAt(1)).getValue().longValue(); this.commitment = ASN1OctetString.getInstance(sequence.getObjectAt(2)).getOctets(); }
From source file:org.cryptoworkshop.ximix.common.asn1.message.SeedMessage.java
License:Apache License
private SeedMessage(ASN1Sequence sequence) { this.boardName = DERUTF8String.getInstance(sequence.getObjectAt(0)).getString(); this.operationNumber = ASN1Integer.getInstance(sequence.getObjectAt(1)).getValue().longValue(); }