Example usage for org.bouncycastle.asn1 ASN1Sequence getObjectAt

List of usage examples for org.bouncycastle.asn1 ASN1Sequence getObjectAt

Introduction

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

Prototype

public ASN1Encodable getObjectAt(int index) 

Source Link

Document

Return the object at the sequence position indicated by index.

Usage

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();
}

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

License:Apache License

private ShareMessage(ASN1Sequence seq) {
    this.sequenceNo = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue();
    this.shareData = seq.getObjectAt(1);
}

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

License:Apache License

private SignatureCreateMessage(ASN1Sequence seq) {
    this.keyID = DERUTF8String.getInstance(seq.getObjectAt(0)).getString();
    this.threshold = ASN1Integer.getInstance(seq.getObjectAt(1)).getValue().intValue();
    this.message = ASN1OctetString.getInstance(seq.getObjectAt(2)).getOctets();
    this.nodesToUse = MessageUtils.toOrderedSet(ASN1Sequence.getInstance(seq.getObjectAt(3)));
}

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

License:Apache License

private StoreMessage(ASN1Sequence sequence) {
    this.id = DERUTF8String.getInstance(sequence.getObjectAt(0)).getString();
    this.secretShareMessage = sequence.getObjectAt(1);
}

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

License:Apache License

private TranscriptBlock(ASN1Sequence seq) {
    this.stepNo = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().intValue();
    this.details = ASN1Sequence.getInstance(seq.getObjectAt(1));
}

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

License:Apache License

private TranscriptDownloadMessage(ASN1Sequence seq) {
    this.queryID = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().longValue();
    this.operationNumber = ASN1Integer.getInstance(seq.getObjectAt(1)).getValue().longValue();
    this.stepNo = ASN1Integer.getInstance(seq.getObjectAt(2)).getValue().intValue();
    this.type = TranscriptType.values()[ASN1Integer.getInstance(seq.getObjectAt(3)).getValue().intValue()];
    this.maxNumberOfMessages = ASN1Integer.getInstance(seq.getObjectAt(4)).getValue().intValue();
    this.withPairing = ASN1Boolean.getInstance(seq.getObjectAt(5)).isTrue();

    if (seq.size() > 6) {
        this.seed = ASN1OctetString.getInstance(seq.getObjectAt(6)).getOctets();
    } else {/*from  w  w w.  j av a2 s  .  c om*/
        this.seed = null;
    }
}

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

License:Apache License

private TranscriptQueryMessage(ASN1Sequence seq) {
    this.operationNumber = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().longValue();
}

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

License:Apache License

private TranscriptQueryResponse(ASN1Sequence seq) {
    this.queryID = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().longValue();
    this.boardName = DERUTF8String.getInstance(seq.getObjectAt(1)).getString();

    ASN1Sequence steps = ASN1Sequence.getInstance(seq.getObjectAt(2));

    stepNos = new int[steps.size()];

    for (int i = 0; i != stepNos.length; i++) {
        stepNos[i] = ASN1Integer.getInstance(steps.getObjectAt(i)).getValue().intValue();
    }//from   w  w w  . ja va  2  s  .  co m
}

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

License:Apache License

private TranscriptTransferMessage(ASN1Sequence sequence) {
    this.stepNo = ASN1Integer.getInstance(sequence.getObjectAt(0)).getValue().intValue();
    if (sequence.size() > 1) {
        this.chunk = DEROctetString.getInstance(sequence.getObjectAt(1)).getOctets();
    } else {//  w w w  .  j a v  a 2s  .  c  o m
        this.chunk = null;
    }
}