【问题标题】:Where does user private key is stored in fabric-ca in user key generation process用户私钥在用户密钥生成过程中存储在fabric-ca中的什么位置
【发布时间】:2021-10-13 16:11:07
【问题描述】:

我正在使用fabric ca-client 来注册和注册“用户”以与链码进行交互。使用组织 CA admin 注册用户如下:

export FABRIC_CA_CLIENT_TLS_CERTFILES=/tmp/hyperledger/org1/ca/crypto/ca-cert.pem
export FABRIC_CA_CLIENT_HOME=/tmp/hyperledger/org1/ca/admin
export FABRIC_CA_CLIENT_MSPDIR=msp

fabric-ca-client register -d --id.name userk2 --id.secret userk2PW --id.type user -u https://0.0.0.0:7054 

并且注册的用户没有 org-ca 的管理员身份

fabric-ca-client enroll -u "https://userk2:userk2PW@0.0.0.0:7054"  --tls.certfiles /tmp/hyperledger/org1/admin/msp/cacerts/0-0-0-0-7054.pem

现在 CA 服务器应该向需要与链码交互的用户(此处为 userk2)提供用户证书。

我收到来自 CA 服务器的响应:

2021/10/13 12:13:50 [INFO] TLS Enabled
2021/10/13 12:13:50 [INFO] generating key: &{A:ecdsa S:256}
2021/10/13 12:13:50 [INFO] encoded CSR
2021/10/13 12:13:51 [INFO] Stored client certificate at /root/.fabric-ca-client/msp/signcerts/cert.pem
2021/10/13 12:13:51 [INFO] Stored root CA certificate at /root/.fabric-ca-client/msp/cacerts/0-0-0-0-7054.pem
2021/10/13 12:13:51 [INFO] Stored Issuer public key at /root/.fabric-ca-client/msp/IssuerPublicKey
2021/10/13 12:13:51 [INFO] Stored Issuer revocation public key at /root/.fabric-ca-client/msp/IssuerRevocationPublicKey

与链码交互的用户私钥/公钥和信任根是什么? 谢谢!

【问题讨论】:

    标签: hyperledger-fabric hyperledger-fabric-ca


    【解决方案1】:

    用户私钥存储在客户端中,而不是 Fabric-CA 中。客户端从不共享其私钥(正如预期的那样)。客户端生成密钥对,向 CA 提交 CSR 并接收签名证书。客户端保存收到的证书(CA 也保存一份副本)。

    根据您的日志,您的客户端证书位于:

    • /root/.fabric-ca-client/msp/signcerts/cert.pem

    而且你的私钥必须在:

    • /root/.fabric-ca-client/msp/keystore/

    【讨论】:

    • sudo ls /root/.fabric-ca-client/msp/keystore 有这个密钥文件,它看起来像私钥 1919a​​13df81f92f38f7daae294db921a040fd71ca63506ae40e00be04cf63cbc_sk。
    • 这是你的钥匙。
    猜你喜欢
    • 2020-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-28
    • 2021-05-12
    相关资源
    最近更新 更多