MCPcopy Index your code
hub / github.com/nodejs/node / exportKeyJWK

Function exportKeyJWK

lib/internal/crypto/webcrypto.js:601–691  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

599}
600
601function exportKeyJWK(key) {
602 const algorithm = getCryptoKeyAlgorithm(key);
603 let alg;
604 switch (algorithm.name) {
605 case 'RSASSA-PKCS1-v1_5': {
606 alg = normalizeHashName(
607 algorithm.hash.name,
608 normalizeHashName.kContextJwkRsa);
609 break;
610 }
611 case 'RSA-PSS': {
612 alg = normalizeHashName(
613 algorithm.hash.name,
614 normalizeHashName.kContextJwkRsaPss);
615 break;
616 }
617 case 'RSA-OAEP': {
618 alg = normalizeHashName(
619 algorithm.hash.name,
620 normalizeHashName.kContextJwkRsaOaep);
621 break;
622 }
623 case 'ECDSA':
624 // Fall through
625 case 'ECDH':
626 // Fall through
627 case 'X25519':
628 // Fall through
629 case 'X448':
630 // Fall through
631 case 'ML-DSA-44':
632 // Fall through
633 case 'ML-DSA-65':
634 // Fall through
635 case 'ML-DSA-87':
636 // Fall through
637 case 'ML-KEM-512':
638 // Fall through
639 case 'ML-KEM-768':
640 // Fall through
641 case 'ML-KEM-1024':
642 break;
643 case 'Ed25519':
644 // Fall through
645 case 'Ed448':
646 alg = algorithm.name;
647 break;
648 case 'AES-CTR':
649 // Fall through
650 case 'AES-CBC':
651 // Fall through
652 case 'AES-GCM':
653 // Fall through
654 case 'AES-OCB':
655 // Fall through
656 case 'AES-KW':
657 alg = require('internal/crypto/aes')
658 .getAlgorithmName(algorithm.name, algorithm.length);

Callers 1

exportKeySyncFunction · 0.85

Calls 6

getCryptoKeyAlgorithmFunction · 0.85
normalizeHashNameFunction · 0.85
getCryptoKeyUsagesFunction · 0.85
getCryptoKeyExtractableFunction · 0.85
getCryptoKeyHandleFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…