How to use the ref-napi.types.CString function in ref-napi

To help you get started, we’ve selected a few ref-napi 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 symphonyoss / SymphonyElectron / src / app / crypto-handler.ts View on Github external
]],

    AESDecryptGCM: [types.int32, [
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        types.uint32,
        refType(types.uchar),
        refType(types.uchar),
        types.uint32,
        refType(types.uchar),
    ]],

    getVersion: [types.CString, []],
});

interface ICryptoLib {
    AESGCMEncrypt: (name: string, base64IV: string, base64AAD: string, base64Key: string, base64In: string) => string | null;
    AESGCMDecrypt: (base64IV: string, base64AAD: string, base64Key: string, base64In: string) => string | null;
}

class CryptoLibrary implements ICryptoLib {

    /**
     * Encrypt / Decrypt
     *
     * @param name {string} Method name to execute
     * @param base64IV {string}
     * @param base64AAD {string}
     * @param base64Key {string}