Replies: 1 comment
-
This discussion area is for the new Fabric Gateway client API currently under development, not for the existing client SDKs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am starting a new discussion related to https://github.com/hyperledger/fabric-gateway/discussions/127
I manage to successfully enroll the Admin user with this Java code:
The problem here is that the pem certificate I used is copy-pasted from the wallet directory imported with a separate Node.js client app. I clearly can not use this method of getting the pem certificate in a stand-alone Java client, so my question is where to get the PEM certificate from? I tried using the certificate found in the connection.json file under connection.json["certificateAuthorities"][adr]["tlsCACerts"]["pem"] but I get an exception thrown ( ERROR org.hyperledger.fabric_ca.sdk.HFCAClient - org.hyperledger.fabric.sdk.exception.CryptoException: Unable to add CA certificate to trust store. Error: java.io.IOException: Incomplete data ).
Another place I can think of to get the PEM is from the MyOrg_Admin_identity.json file that I downloaded from the IBM cloud blockchain web console when I created the user MyOrg_Admin; this file specifies a certificate but the string there is not in the PEM format (it doesn't start with -----BEGIN CERTIFICATE----- ); here is the format of MyOrg_Admin_identity.json:
The Node.js client code I used to import the wallet didn't need any PEM certificate, it just needed the username and password of the Admin user and the ca name and url. If the Java code needs this certificate where do I get it from?
Thanks & regards,
Ionut
Later edit: my fault: the enrollment does NOT work with the above java code, I forgot to un-comment the ca.enroll() line, but the question still remains how to enroll an admin user and which PEM certificate to use ...
Beta Was this translation helpful? Give feedback.
All reactions