Hyperledger Fabric教程(2)-- byfn.sh分析-生成身份证书

2021/6/17 12:27:45

本文主要是介绍Hyperledger Fabric教程(2)-- byfn.sh分析-生成身份证书,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

证书存放位置

shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peerOrganizations
drwxr-xr-x 3 shijianfeng shijianfeng 4096 Jan  6 05:59 ordererOrganizations
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/
total 8
drwxr-xr-x 7 shijianfeng shijianfeng 4096 Jan  6 05:59 org1.example.com
drwxr-xr-x 7 shijianfeng shijianfeng 4096 Jan  6 05:59 org2.example.com
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/
total 20
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 ca
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 users
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 tlsca
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peers
drwxr-xr-x 5 shijianfeng shijianfeng 4096 Jan  6 05:59 msp
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/peers/
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer1.org1.example.com
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer0.org1.example.com
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/
total 8
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 tls
drwxr-xr-x 7 shijianfeng shijianfeng 4096 Jan  6 05:59 msp
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/ca/
total 8
-rw-rw-r-- 1 shijianfeng shijianfeng 847 Jan  6 05:59 ca.org1.example.com-cert.pem
-rwx------ 1 shijianfeng shijianfeng 241 Jan  6 05:59 1f9c603a2afcdfc65e12d5f65e4245e09131d31e810ebc6f86f3cff0220b3fef_sk
shijianfeng@k8s-master:~/fabric-samples/first-network$ 

 

 

 

cryptogen generate --config=./crypto-config.yaml

  • --ca:存放组织的根证书和对应的私钥文件,组织内的实体将基于该根证书作为证书 根。
  • --cacerts:组织的根证书,同ca目录下文件。
  • --admincerts:组织管理员的身份验证证书。Peer将基于这些证书来认证交易签署者是 否为 管理员身份。
  • --cacerts:存放组织的根证书。
  • --keystore:本节点的身份私钥,用来签名。
  • --signcerts:验证本节点签名的证书,被组织根证书签名。
  • --tlscacerts:TLS连接用的身份证书,即组织TLS证书。

 

 

vim crypto-config.yaml

 

shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peerOrganizations
drwxr-xr-x 3 shijianfeng shijianfeng 4096 Jan  6 05:59 ordererOrganizations
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/ordererOrganizations/example.com/
total 20
drwxr-xr-x 3 shijianfeng shijianfeng 4096 Jan  6 05:59 users
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 tlsca
drwxr-xr-x 3 shijianfeng shijianfeng 4096 Jan  6 05:59 orderers
drwxr-xr-x 5 shijianfeng shijianfeng 4096 Jan  6 05:59 msp
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 ca
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/ordererOrganizations/example.com/orderers/
total 4
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 orderer.example.com

shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org
org1.example.com/ org2.example.com/ 
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/peers
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer1.org1.example.com
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer0.org1.example.com
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/users/
Admin@org1.example.com/ User1@org1.example.com/ 
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/
total 20
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 ca
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 users
drwxr-xr-x 2 shijianfeng shijianfeng 4096 Jan  6 05:59 tlsca
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peers
drwxr-xr-x 5 shijianfeng shijianfeng 4096 Jan  6 05:59 msp
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/peers/
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer1.org1.example.com
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 peer0.org1.example.com
shijianfeng@k8s-master:~/fabric-samples/first-network$ ls -lrt crypto-config/peerOrganizations/org1.example.com/users/
total 8
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 User1@org1.example.com
drwxr-xr-x 4 shijianfeng shijianfeng 4096 Jan  6 05:59 Admin@org1.example.com
shijianfeng@k8s-master:~/fabric-samples/first-network$ 

 



这篇关于Hyperledger Fabric教程(2)-- byfn.sh分析-生成身份证书的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程