在 Hyperledger Fabric 中生成具有属性的证书
Generation of Certificates with Attributes in Hyperledger Fabric
我正在按照 docs to generate an ecert with test attributes. But I am not being able to do it. I am using fabric-ca-client version 1.1.0-preview which according to this issue 中的说明进行操作,应该支持属性证书(我也尝试了更新的版本)。
我的工作:
注册管理员:
$ 出口 FABRIC_CA_CLIENT_HOME=/etc/hyperledger/fabric-ca;
fabric-ca-client enroll -u http://admin:adminpw@localhost:7054
注册客户端:
$ fabric-ca-client register --id.name user1 --id.secret user1pw --id.type user --id.affiliation org1 --id.attrs attr1=val1:ecert
注册客户:
$ export FABRIC_CA_CLIENT_HOME=/etc/hyperledger/fabric-ca/clients/user1; fabric-ca-client enroll -u http://user1:user1pw@localhost:7054
但是,openssl x509 -in /etc/hyperledger/fabric-ca/clients/user1/msp/signcerts/cert.pem -text -noout 显示没有属性的证书.
问题:
- 甚至可以使用 fabric-ca-client 实用程序生成带有属性的证书吗?根据此 issue“"fabric-ca-client register" CLI 命令将得到增强以支持 ...”。但是,在主要文档中,它被解释为好像已经可以做到了。
- 如果确实可以的话,我做错了(或可能做错了什么)?由于我使用管理员身份注册和注册新的 ecert,我假设对于我可以添加到 ecert 的属性没有任何限制(但是,我也尝试遵循 here 规定的条件)。
- 如果不可能,推荐的方法是什么?使用任何 SDK 进行生成是否有效?
谢谢。
已解决。
原来我用的不是fabric-ca-client version 1.1.0-preview。使用该版本,问题中的命令序列可以正确生成具有属性的证书。
我正在按照 docs to generate an ecert with test attributes. But I am not being able to do it. I am using fabric-ca-client version 1.1.0-preview which according to this issue 中的说明进行操作,应该支持属性证书(我也尝试了更新的版本)。
我的工作:
注册管理员:
$ 出口 FABRIC_CA_CLIENT_HOME=/etc/hyperledger/fabric-ca; fabric-ca-client enroll -u http://admin:adminpw@localhost:7054
注册客户端:
$ fabric-ca-client register --id.name user1 --id.secret user1pw --id.type user --id.affiliation org1 --id.attrs attr1=val1:ecert
注册客户:
$ export FABRIC_CA_CLIENT_HOME=/etc/hyperledger/fabric-ca/clients/user1; fabric-ca-client enroll -u http://user1:user1pw@localhost:7054
但是,openssl x509 -in /etc/hyperledger/fabric-ca/clients/user1/msp/signcerts/cert.pem -text -noout 显示没有属性的证书.
问题:
- 甚至可以使用 fabric-ca-client 实用程序生成带有属性的证书吗?根据此 issue“"fabric-ca-client register" CLI 命令将得到增强以支持 ...”。但是,在主要文档中,它被解释为好像已经可以做到了。
- 如果确实可以的话,我做错了(或可能做错了什么)?由于我使用管理员身份注册和注册新的 ecert,我假设对于我可以添加到 ecert 的属性没有任何限制(但是,我也尝试遵循 here 规定的条件)。
- 如果不可能,推荐的方法是什么?使用任何 SDK 进行生成是否有效?
谢谢。
已解决。
原来我用的不是fabric-ca-client version 1.1.0-preview。使用该版本,问题中的命令序列可以正确生成具有属性的证书。