在生产环境中使用 cryptogen

Using the cryptogen for Production environment

我有关于 cryptogen 和 hyperledger fabric 网络设置的问题。我想解释一下我的工作流程。我想知道这个程序可以用于生产

1. I have 2organisation org1,org2.In which each organisation consist two peers,only one ordered for 
   both organisation and 2 fabric-ca server.
2. Generating the all the key pairs using the cryptogen tool using the crypto-config.yaml.
3. Generating genesis block and channel transaction using the configtx tool with configtx.yaml. 
4. (Important Note:)I am using the CA private key and certificate ca.org1.example.com-cert.pem, which is generated using the cryptogen tool in my network docker yaml file to setup the fabric ca.
5. After setup all i am running the network its works fine.
6. I am enrolling and registering the admin and user from the outside using the fabricnodesdk.

这里是使用 cryptogen 生成 ca 私钥和证书来设置和 运行 生产中的 CA 服务器的良好做法。如果这不是很好的做法,我有没有其他方法可以实现它。请您的建议对我有所帮助。

Hyperledger Fabric 文档建议不要在生产环境中使用 cryptogen 工具

原因:它是一个工具,所有加密 material 都是动态生成的,有效期为 10 年,您无法使用 fabric-CA 进行进一步控制,如撤销,重新注册等,因为 fabric-ca 在数据库中没有副本

传统方式:通过注册和注册有效期为 1 年的身份,使用 fabric-CA 生成加密material

但是如果你接受我的意见,我在 2 年前就在一个生产环境中使用过 cryptogen 工具。在生产中使用 cryptogen 工具没有任何危害,除非您需要与 CA 交互以更改身份。这取决于我们用例中的用例,我们不需要不断更改身份,它已永久固定,这是一个典型的用例

But later and now I have been using fabric-CA and custom CA to generate crypto materials leveraging more possibilities

我发现这是一种肮脏的方式。您的 Fabric-CA 正在工作,您的订购者和同行当然也在工作,因为他们的证书是正确的并且已经由 CA 适当地签名。但事实是,你通过 cryptogen 生成的 orderer、peer 和 clients 对应的身份并没有在 Fabric-CA 数据库中注册,所以你无法通过你的 Fabric-CA 管理或撤销这些身份及其对应的证书未来。

我的建议(当然是针对生产环境):不要偷懒;注意适当的 fabric-ca-server-config.yamlfabric-ca-client-config.yaml 配置;安全地启动你的 Fabric-CA;并为您的初始身份注册、证书注册和 MSP/TLS 文件夹结构创建编写脚本。