This is a pre-implementation question.
We have a working fabric(2.2) application with an org containing 2 peers, an intermediate CA with TLS enabled and are now planning to implement HSM to store org related private keys. I read from official doc and other articles that to use HSM we need to have PKCS11 enabled docker centOS images and the setup requires a complete rebuild of the binaries and network.
- Can we setup HSM w/o disturbing the existing network?
- Does peer's couchDB container requires to be reconfigured as well if the answer for Q1 is "yes"?
- How do we transfer the available private keys from local MSP keystore to HSM slots?
- What are the points to take care while implementing HSM along with TLS/TLS enable existing keys?
- Do we have a ready script for this operation in any samples (I did not find it so far)?
(removed point 6 and rearranged)
- I have seen very few people talking about implementing HSM with HLF, is there any major issue of usage.
Also please do provide a "take care" points before starting this operation.
PKCS11 is a standard interface, not a standard protocol. Each HSM vendor has its own protocol (usually over TCP). They provide a library that speaks their proprietary protocol that you install in your application.
So a HSM is "just" another TCP based service running outside your cluster. To some extent, you connect to an HSM the same way you would connect to a LDAP server:
hsm-provider.so) and its configuration file in your environmentThe specifics (especially local configuration) depend on the HSM provider. Here is a script that configures an HSM emulated in software for Hashicorp Vault. YMMV but this software emulator separates the HSM part from the networking part.
Once you figure out the HSM part, I suggest you look into Utimaco HSM emulator (registration required). You connect to the emulator via a TCP/IP connection, making it as real as can be from Hyperledger's point of view.