Search in sources :

Example 1 with DigitalSignature

use of com.jd.blockchain.ledger.DigitalSignature in project jdchain-core by blockchain-jd-com.

the class TransactionRequestExtensionImpl method resolveSigners.

private void resolveSigners() {
    if (request.getEndpointSignatures() != null) {
        for (DigitalSignature signature : request.getEndpointSignatures()) {
            Credential cred = new Credential(signature);
            endpointSignatures.put(cred.getIdentity().getAddress(), cred);
        }
    }
    if (request.getNodeSignatures() != null) {
        for (DigitalSignature signature : request.getNodeSignatures()) {
            Credential cred = new Credential(signature);
            nodeSignatures.put(cred.getIdentity().getAddress(), cred);
        }
    }
}
Also used : DigitalSignature(com.jd.blockchain.ledger.DigitalSignature)

Example 2 with DigitalSignature

use of com.jd.blockchain.ledger.DigitalSignature in project jdchain-core by blockchain-jd-com.

the class LedgerInitializeWebController method getNodesSignatures.

private DigitalSignature[] getNodesSignatures() {
    ParticipantNode[] parties = this.ledgerInitConfig.getParticipants();
    List<DigitalSignature> signatures = new ArrayList<>();
    for (int i = 0; i < parties.length; i++) {
        if (parties[i].getParticipantNodeState() != ParticipantNodeState.CONSENSUS) {
            continue;
        }
        PubKey pubKey = parties[i].getPubKey();
        SignatureDigest signDigest = this.permissions[i].getTransactionSignature();
        signatures.add(new DigitalSignatureBlob(pubKey, signDigest));
    }
    return signatures.toArray(new DigitalSignature[signatures.size()]);
}
Also used : PubKey(com.jd.blockchain.crypto.PubKey) ParticipantNode(com.jd.blockchain.ledger.ParticipantNode) SignatureDigest(com.jd.blockchain.crypto.SignatureDigest) DigitalSignatureBlob(com.jd.blockchain.transaction.DigitalSignatureBlob) ArrayList(java.util.ArrayList) DigitalSignature(com.jd.blockchain.ledger.DigitalSignature)

Aggregations

DigitalSignature (com.jd.blockchain.ledger.DigitalSignature)2 PubKey (com.jd.blockchain.crypto.PubKey)1 SignatureDigest (com.jd.blockchain.crypto.SignatureDigest)1 ParticipantNode (com.jd.blockchain.ledger.ParticipantNode)1 DigitalSignatureBlob (com.jd.blockchain.transaction.DigitalSignatureBlob)1 ArrayList (java.util.ArrayList)1