Offline Transaction Signing with Fabric Node SDK


White, Spencer (S.)
 

Hello,

Has anyone successfully implemented offline transaction signing using the tutorial from either v1.4 or current master of the Fabric Node SDK?


I am running into an issue with this line: const { prvKeyHex } = KEYUTIL.getKey(privateKeyPEM);

prvKeyHex always ends up as undefined. I have reviewed the jsrsasign documentation for KEYUTIL and it doesn't seem like this method produces a hex key as the fabric tutorials suggest.

Any thoughts are appreciated.

Sincerely,

Spencer


White, Spencer (S.)
 

Hi Again,

I went ahead and used a different method for generating the Key and CSR, based on this answer/tutorial: https://stackoverflow.com/questions/59725180/hyperledger-fabric-node-js-sdk-issue-with-offline-transaction-signatures.

I also implemented a different method for converting from PEM to Hex. At first I was seeing this issue.

2020-06-04 00:44:03.111 UTC [protoutils] ValidateProposalMessage -> WARN 14d channel [mychannel]: creator's signature over the proposal is not valid: could not determine the validity of the signature: Failed verifing with opts [<nil>]: Invalid S. Must be smaller than half the order [85924218970434167272863162246737202703728205202488520080444473492031893175980][57896044605178124381348723474703786764998477612067880171211129530534256022184].


I then continued following the tutorial, implemented the _preventMalleability function to fix the size issue and now I am seeing this error:

2020-06-04 00:57:25.252 UTC [protoutils] ValidateProposalMessage -> WARN 162 channel [mychannel]: creator's signature over the proposal is not valid: The signature is invalid


Is there any easy way to debug what might be wrong? I am getting the certificate back from the Certificate Authority. I see in the logs for the CA docker container that the enroll was successful. This is further validated by the enrollment being returned with what looks to be a valid certificate and root certificate that I write to a file.

Thanks again for any input!

Sincerely,

Spencer


From: White, Spencer (S.)
Sent: Wednesday, June 3, 2020 6:11 PM
To: fabric@... <fabric@...>
Subject: Offline Transaction Signing with Fabric Node SDK
 
Hello,

Has anyone successfully implemented offline transaction signing using the tutorial from either v1.4 or current master of the Fabric Node SDK?


I am running into an issue with this line: const { prvKeyHex } = KEYUTIL.getKey(privateKeyPEM);

prvKeyHex always ends up as undefined. I have reviewed the jsrsasign documentation for KEYUTIL and it doesn't seem like this method produces a hex key as the fabric tutorials suggest.

Any thoughts are appreciated.

Sincerely,

Spencer