Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const decryptRemoteProposalResponse = (proposalResponseBytes64: string, eciesPrivateKeyPEM: any) => {
const privKey = keyutil.getKeyFromPlainPrivatePKCS8PEM(eciesPrivateKeyPEM);
const propResp = deserializeRemoteProposalResponseBase64(proposalResponseBytes64);
const decryptionOptions = { hashAlgorithm: "SHA2" };
//@ts-ignore Issue with propResp.payload not being a string but errors when converted to a string
propResp.payload = eciesCrypto.eciesDecryptMessage(privKey, propResp.payload, decryptionOptions);
return propResp;
};
const decryptRemoteChaincodeOutput = (proposalResponseBytes64, eciesPrivateKeyPEM) => {
const privKey = keyutil.getKeyFromPlainPrivatePKCS8PEM(eciesPrivateKeyPEM);
const propResp = deserializeRemoteProposalResponseBase64(proposalResponseBytes64);
const decryptionOptions = { hashAlgorithm: "SHA2" };
//@ts-ignore Issue with propResp.payload not being a string but errors when converted to a string
propResp.response.payload = eciesCrypto.eciesDecryptMessage(privKey, propResp.response.payload, decryptionOptions);
return propResp;
};