How to get the public key of a client inside the chaincode ? #signcerts #fabric-chaincode


K Sanjay Kumar
 

I want to create a  verifiable public key log of clients. These public keys are then queried to perform off chain verification of documents issued by the corresponding private key. 


I looked through "clientIdentity" class (https://hyperledger.github.io/fabric-chaincode-node/release-2.2/api/fabric-shim.ClientIdentity.html) , and I couldn't find anything that would return me public key of the client.  

Is there any built in libraries already available? Or could anyone please guide me where and how to add this function. 


Mark Lewis
 

ClientIdentity.getIDBytes() will give you the PEM-encoded X.509 certificate of the client, which contains the public key.


K Sanjay Kumar
 

Thank you. 


On Thu, 9 Dec 2021 at 02:29, Mark Lewis <Mark.S.Lewis@...> wrote:
ClientIdentity.getIDBytes() will give you the PEM-encoded X.509 certificate of the client, which contains the public key.