本文整理匯總了TypeScript中crypto.ECDH.convertKey方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ECDH.convertKey方法的具體用法?TypeScript ECDH.convertKey怎麽用?TypeScript ECDH.convertKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類crypto.ECDH
的用法示例。
在下文中一共展示了ECDH.convertKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
N: 16384,
r: 8,
p: 1,
maxmem: 32 * 1024 * 1024
};
crypto.scrypt(pwd, salt, 64, opts, (err: Error | null, derivedKey: Buffer): void => {});
crypto.scrypt(pwd, salt, 64, { maxmem: 16 * 1024 * 1024 }, (err: Error | null, derivedKey: Buffer): void => {});
let buf: Buffer = crypto.scryptSync(pwd, salt, 64);
buf = crypto.scryptSync(pwd, salt, 64, opts);
buf = crypto.scryptSync(pwd, salt, 64, { N: 1024 });
}
{
let key: string | Buffer = Buffer.from("buf");
const curve = "secp256k1";
let ret: string | Buffer = crypto.ECDH.convertKey(key, curve);
key = "0xfff";
ret = crypto.ECDH.convertKey(key, curve);
ret = crypto.ECDH.convertKey(key, curve, "hex");
ret = crypto.ECDH.convertKey(key, curve, "hex", "hex");
ret = crypto.ECDH.convertKey(key, curve, "hex", "hex", "uncompressed");
ret = crypto.ECDH.convertKey(key, curve, "hex", "hex", "compressed");
ret = crypto.ECDH.convertKey(key, curve, "hex", "hex", "hybrid");
}
{
const rsaRes: {
publicKey: Buffer;
privateKey: string;
} = crypto.generateKeyPairSync('rsa', {
modulusLength: 123,