美文网首页
Hyperledger Fabric Node SDK key-

Hyperledger Fabric Node SDK key-

作者: Zhao_Chaoyi | 来源:发表于2017-11-02 11:41 被阅读0次

    key-value-store: some CryptoSuite implementation requires a key store to persist private keys. A CryptoKeyStore is provided for this purpose, which can be used on top of any implementation of the KeyValueStore interface, such as a file-based store or a database-based one. The specific implementation is determined by the value of this configuration setting.

    Fabric Node SDK 提供了 FabricCAService

    npm i fabric-ca-client --save
    

    Sample code:

    let CAClient = require('fabric-ca-client');
    // No TLS
    let tlsOptions = {
        trustedRoots: [],
        verify: false
    };
    
    let crypto = CAClient.newCryptoSuite({
        software: true,
        keysize: 384
    });
    
    // file-based store
    let keyValStorePath = path.join(os.tmpDir(), 'kvsTemp');
    let cks = CAClient.newCryptoKeyStore({path:keyValStorePath});
    crypto.setCryptoKeyStore(cks);
    
    var client = new CAClient('http://localhost:7054', tlsOptions, 'peerOrg1', crypto);
    client.setCryptoSuite(crypto);
    
    

    相关文章

      网友评论

          本文标题:Hyperledger Fabric Node SDK key-

          本文链接:https://www.haomeiwen.com/subject/resopxtx.html