Enroll and Register a Fabric CA Client

  1. Edit the fabric-ca-server-config.yaml file inside the container and change the identity section as needed.

  2. Start the server if it is not currently running. It must be running for the enroll command to work.

  3. Create a directory environment variable.

›_ Console

# export FABRIC_CA_CLIENT_HOME=$HOME/fabric-ca/clients/admin 
  1. Enroll under the identity in the server YAML file.

›_ Console

# fabric-ca-client enroll -u http://admin:adminpw@localhost:7055 
image-3285188835-1.jpg

Fabric-CA-Client enroll

This command will generate default fabric-ca-client-config.yaml configuration file and msp directory. This configuration file will be used to make HSM related configuration changes in the next step. The client is not yet enrolled through the HSM.

  1. Edit the client YAML file in your home directory.

  2. Delete the msp directory and edit the YAML file in the home directory.

  3. Edit the bccsp section and mirror the same configuration from fabric-ca-serverconfig.yaml file for BCCSP section for HSM.

›_ Console

# cd /root/fabric-ca/clients/admin 

# vim fabric-ca-client-config.yaml 
image-3285188835-3.jpg

Fabric-CA-Client config file

  1. Run the enroll command again with the server identity.

›_ Console

# fabric-ca-client enroll -u http://admin:adminpw@localhost:7055 
image-3285188835-4.jpg

Fabric-CA-Client enroll

  1. Register the client. For example.

›_ Console

# fabric-ca-client register --id.name ica.example --id.type client -id.secret root --csr.names C=es,ST=madrid,L=Madrid,O=example.com --csr.cn ica.example -m ica.example --id.attrs '"hf.IntermediateCA=true"' u http://localhost:7055 --loglevel debug 
image-3285188835-5.jpg

Register the client

  1. Run the enroll command again with the client identity.

›_ Console

# fabric-ca-client enroll -u http://ica.example:root@localhost:7055 
image-3285188835-6.jpg

Fabric-CA-Client enroll