Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA管理功能 #171

Open
dengyi9 opened this issue Jan 8, 2019 · 7 comments
Open

CA管理功能 #171

dengyi9 opened this issue Jan 8, 2019 · 7 comments
Labels
epic Like JIRA epic task, lots of work are required.
Milestone

Comments

@dengyi9
Copy link
Collaborator

dengyi9 commented Jan 8, 2019

目前登录页由用户手动导入证书,证书生成过程未涉及。
而Fabric有ca-server服务,考虑使用fabric-ca-client sdk库,实现调用ca-server注册用户,获取用户私钥与证书等功能。

@dengyi9 dengyi9 added the epic Like JIRA epic task, lots of work are required. label Jan 8, 2019
@dengyi9
Copy link
Collaborator Author

dengyi9 commented Jan 9, 2019

fabric-ca-client功能, 参考https://fabric-sdk-node.github.io/index.html

  • 注册新用户,获取身份秘钥:register a new user
  • 登入用户,使用身份秘钥:enroll a user to obtain the enrollment certificate signed by the Fabric CA
  • 注销用户:revoke an existing user by enrollment ID or revoke a specific certificate

@IamChuancey
Copy link
Collaborator

主要解决问题:一个fabric-ca-server是否可以同时生成User类型的msp和tls证书,
另:fabric-ca-clinent是否可能生成admin user的证书?

@dengyi9
Copy link
Collaborator Author

dengyi9 commented Mar 10, 2019

基本确认fabric-ca-server可生成peer, user各类证书。 在此简要记录一下。

  1. fabric-ca-server init时,会生成ca根证书与私钥,即ca-cert.pem与Issuer*文件

  2. fabric-ca-server start时, 若配置文件fabric-ca-server-config.yaml中启用tls,则启动时会生成tls-cert.pem,该证书用作tls通讯。 即peer, user的tlsca通讯都使用该证书。

生成文件如下

dengyi@localhost:~/Documents/devs/playground/fabric-ca-server-init$ ll
total 192
-rw-r--r--  1 dengyi  staff    843 Mar 10 21:28 IssuerPublicKey
-rw-r--r--  1 dengyi  staff    215 Mar 10 21:28 IssuerRevocationPublicKey
-rw-r--r--  1 dengyi  staff    786 Mar 10 21:28 ca-cert.pem
-rw-r--r--  1 dengyi  staff  17730 Mar 10 21:28 fabric-ca-server-config.yaml
-rw-r--r--  1 dengyi  staff  61440 Mar 10 21:39 fabric-ca-server.db
drwxr-xr-x  6 dengyi  staff    192 Mar 10 21:39 msp
-rw-r--r--  1 dengyi  staff    904 Mar 10 21:39 tls-cert.pem
  1. fabric-ca-server启动后,使用fabric-ca-client注册(register)或登入(enroll), 注册仅为server端登记,而登入则会在client端输出证书与私钥

  2. 启动tls的网络,使用命令fabric-ca-client 时需注意,相比官方文档无TLS的示例 (1)enroll admin时使用参数 --tls.certfiles tls-cert.pem (2) register新用户时,修改fabric-ca-client-config.yaml中tls相关配置,如tls.certiles使用ca-cert.pem

具体操作流程可参考 https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#enrolling-the-bootstrap-identity

@dengyi9
Copy link
Collaborator Author

dengyi9 commented Mar 11, 2019

关于功能设计,需要考虑的点

  1. CA管理功能的位置? 登录页、功能页?
  2. 功能流程:
    • 输出证书到外部? 或获取后即保留在desktop内部,不输出到外部?
    • TLS证书为fabric-ca-server start启动时生成, ca-client是否能获取到? 若不能,如何设计工作流?
    • CA管理常涉及切换用户, 如使用admin用户做新注册、吊销证书,使用普通user做业务查询,生成peer证书用作节点服务。

@dengyi9
Copy link
Collaborator Author

dengyi9 commented Mar 11, 2019

CA管理页的设计定位(二选一,待定):

  1. 平等peer功能与CA功能。在登录页,做模式切换: peer登陆模式、CA管理模式。
  2. 弱化CA管理功能,将其设计为辅助功能。 在登录页,做CA管理的弹窗设计。

CA管理页,应包含以下功能:

  1. 登录页:登入用户,主要是admin
  2. 功能页:
    • 注册用户 (register)
    • 更新用户 (reenroll)
    • 注销用户 (revoke)

@dengyi9 dengyi9 added this to the v0.3.0 milestone Mar 13, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 14, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 14, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 14, 2019
dengyi9 added a commit that referenced this issue Mar 14, 2019
@dengyi9
Copy link
Collaborator Author

dengyi9 commented Mar 18, 2019

登入流程两种场景:

  1. 用户起初无任何证书私钥,先通过已知的用户、密码,连接CA server操作 enroll admin,获取生成用户证书私钥。随后再进行CA管理操作。
  2. 用户已持有证书私钥,通过导入证书私钥,进行CA管理操作

具体实现考虑:

  • 考虑将第一种场景作为特殊情况,第二种场景作为常用情况。 对第一种场景,在登录页用弹窗处理,并输出证书私钥,以衔接第二种场景使用。相当于网站注册。
  • 由于sdk库fabric-client与 fabric-ca-client 共同使用一套user-key-store,区别在于,fabric-client对接peer与orderer节点, 而fabric-ca-client对接ca-server节点。 考虑登录页共用,选项peer&orderer与ca-server至少填一个。
  • desktop登入后,增加一个功能页--ca管理,在其中实现register, reenroll, revoke等功能。

@dengyi9
Copy link
Collaborator Author

dengyi9 commented Mar 19, 2019

关于功能与权限设计:

  • 由于ca-admin与peer-admin、peer-user为不同证书, 考虑v0.3版本暂不考虑如何区分。 先实现最小功能,即登入、使用功能。但不考虑隐藏无法操作的功能页,如下
    • 若导入为ca-admin,则可用ca管理功能。
    • 若导入为peer-admin,则可用所有peer管理功能,即区块看板、链码调用、链码安装、通道管理。
    • 若导入为peer-admin,则可用peer普通功能,即区块看板、链码调用。
  • v0.4版本,可考虑根据证书属性、参数等,处理功能页面显示,
    • 若为ca-admin登入,则只看到ca管理页
    • 若为peer-admin登入后,看到peer所有功能页, 即区块看板、链码调用、链码安装、通道管理。
    • 若为peer-user登入,则只看到peer普通功能页,无管理页, 即区块看板、链码调用。

dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 20, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 20, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 20, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 20, 2019
dengyi9 added a commit that referenced this issue Mar 20, 2019
implement CA management functions of fabricClient. #171
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 20, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Mar 21, 2019
dengyi9 added a commit that referenced this issue Mar 21, 2019
dengyi9 added a commit to dengyi9/hyperledger-fabric-desktop that referenced this issue Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Like JIRA epic task, lots of work are required.
Projects
None yet
Development

No branches or pull requests

2 participants