(key)
| 463 | } |
| 464 | |
| 465 | function exportKeyPkcs8(key) { |
| 466 | switch (getCryptoKeyAlgorithm(key).name) { |
| 467 | case 'RSASSA-PKCS1-v1_5': |
| 468 | // Fall through |
| 469 | case 'RSA-PSS': |
| 470 | // Fall through |
| 471 | case 'RSA-OAEP': |
| 472 | return require('internal/crypto/rsa') |
| 473 | .rsaExportKey(key, kWebCryptoKeyFormatPKCS8); |
| 474 | case 'ECDSA': |
| 475 | // Fall through |
| 476 | case 'ECDH': |
| 477 | return require('internal/crypto/ec') |
| 478 | .ecExportKey(key, kWebCryptoKeyFormatPKCS8); |
| 479 | case 'Ed25519': |
| 480 | // Fall through |
| 481 | case 'Ed448': |
| 482 | // Fall through |
| 483 | case 'X25519': |
| 484 | // Fall through |
| 485 | case 'X448': |
| 486 | return require('internal/crypto/cfrg') |
| 487 | .cfrgExportKey(key, kWebCryptoKeyFormatPKCS8); |
| 488 | case 'ML-DSA-44': |
| 489 | // Fall through |
| 490 | case 'ML-DSA-65': |
| 491 | // Fall through |
| 492 | case 'ML-DSA-87': |
| 493 | return require('internal/crypto/ml_dsa') |
| 494 | .mlDsaExportKey(key, kWebCryptoKeyFormatPKCS8); |
| 495 | case 'ML-KEM-512': |
| 496 | // Fall through |
| 497 | case 'ML-KEM-768': |
| 498 | // Fall through |
| 499 | case 'ML-KEM-1024': |
| 500 | return require('internal/crypto/ml_kem') |
| 501 | .mlKemExportKey(key, kWebCryptoKeyFormatPKCS8); |
| 502 | default: |
| 503 | return undefined; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | function exportKeyRawPublic(key, format) { |
| 508 | switch (getCryptoKeyAlgorithm(key).name) { |
no test coverage detected
searching dependent graphs…