How to use the jsrsasign.KEYUTIL.getKeyFromPlainPrivatePKCS8PEM function in jsrsasign

To help you get started, we’ve selected a few jsrsasign examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger-labs / weaver-dlt-interoperability / sdks / fabric / interoperation-node-sdk / src / InteroperableHelper.ts View on Github external
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;
};
github hyperledger-labs / weaver-dlt-interoperability / sdks / fabric / interoperation-node-sdk / src / InteroperableHelper.ts View on Github external
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;
};

jsrsasign

opensource free pure JavaScript cryptographic library supports RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp and CAdES and JSON Web Signature(JWS)/Token(JWT)/Key(JWK)

MIT
Latest version published 10 months ago

Package Health Score

77 / 100
Full package analysis