How to use the indy-sdk.keyForLocalDid function in indy-sdk

To help you get started, we’ve selected a few indy-sdk 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 / indy-agent / nodejs / indy / src / crypto / index.js View on Github external
exports.authCrypt = async function (myDid, theirDid, message) {
    let myVerkey = await sdk.keyForLocalDid(await indy.wallet.get(), myDid);
    let theirVerkey = await sdk.keyForLocalDid(await indy.wallet.get(), theirDid);
    let buffer = await sdk.cryptoAuthCrypt(await indy.wallet.get(), myVerkey, theirVerkey, Buffer.from(message, 'utf8'));
    return Buffer.from(buffer).toString('base64')
};
github hyperledger / indy-agent / nodejs / indy / src / crypto / index.js View on Github external
exports.anonDecrypt = async function (did, message) {
    let verKey = await sdk.keyForLocalDid(await indy.wallet.get(), did);
    let decryptedMessageBuffer = await sdk.cryptoAnonDecrypt(await indy.wallet.get(), verKey, message);
    let buffer = Buffer.from(decryptedMessageBuffer).toString('utf8');
    return JSON.parse(buffer);
};
github hyperledger / indy-agent / nodejs / indy / src / crypto / index.js View on Github external
exports.authDecrypt = async function (myDid, message) {
    let myVerkey = await sdk.keyForLocalDid(await indy.wallet.get(), myDid);
    let [, decryptedMessageBuffer] = await sdk.cryptoAuthDecrypt(await indy.wallet.get(), myVerkey, Buffer.from(message, 'base64'));
    let buffer = Buffer.from(decryptedMessageBuffer).toString('utf8');
    return JSON.parse(buffer);
};