本文整理汇总了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,