跳至正文
Wener Notes

WebCrypto

约 1 分钟阅读
bash
# pkcs1 -> pkcs8
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.key -out pkcs8.key

Member RsaHashedImportParams.hash is required and must be an instance of (object or DOMString)

TypeScript
await crypto.subtle.importKey('raw', PEM.decode(key).block.bytes, 'RSA-OAEP', false, ['decrypt']);
await crypto.subtle.importKey(
  'raw',
  PEM.decode(key).block.bytes,
  {
    name: 'RSA-OAEP',
    hash: 'SHA-265',
  },
  false,
  ['decrypt'],
);

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub4 条
其他外链8 条
最近更新commit 8f4d672编辑