feat: implement 6 missing crypto APIs: 15 ❌ → ✅#921
Merged
Conversation
…cKey, verifySpkac
…rInfo, Prime, Argon2 Also clang-format C++ files for Certificate, Cipher, Prime, Argon2
- Add raw format export for EC public keys (uncompressed point encoding) - Support 'raw' format in subtle.exportKey for EC keys - Fix getCipherInfo to use input name instead of cipher.getName() - Switch example dependency to workspace link
- getCipherInfo: use canonical OpenSSL name via cipher.getName(), remove number from signature - Certificate: use safer empty ArrayBuffer pattern (non-null data pointer) - Argon2: include OpenSSL error string in failure messages - Prime: clean up callback signatures with proper union types - Tests: strengthen verifySpkac assertion to assert.isTrue
Contributor
🤖 End-to-End Test Results - AndroidStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
Contributor
🤖 End-to-End Test Results - iOSStatus: ✅ Passed 📸 Final Test ScreenshotScreenshot automatically captured from End-to-End tests and will expire in 30 days This comment is automatically updated on each test run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements 6 previously missing Node.js crypto APIs, flipping 15 ❌ to ✅ in the implementation coverage doc.
New Features
Certificateclass —verifySpkac,exportPublicKey,exportChallenge(SPKAC operations via ncrypto)KeyObject.from()/KeyObject.toCryptoKey()— bidirectional conversion between KeyObject and CryptoKeyECDH.convertKey()— static method for EC point format conversion (compressed/uncompressed/hybrid)getCipherInfo()— returns cipher metadata (name, NID, mode, key length, IV length, block size)generatePrime/generatePrimeSync/checkPrime/checkPrimeSync— prime generation and primality testingargon2/argon2Sync— password hashing with argon2d, argon2i, argon2id (requires OpenSSL 3.2+)Additional Fixes
subtle.exportKey("raw", ecKey)) now works correctlygetCipherInforeturns canonical OpenSSL cipher name (viaOBJ_nid2sn) instead of echoing user inputworkspace:*instead of stale version numberChanges
HybridArgon2,HybridCertificate,HybridPrime, plus additions toHybridCipher,HybridECDH,HybridKeyObjectHandle)argon2.nitro.ts,certificate.nitro.ts,prime.nitro.ts)Testing
Tests run in the React Native example app. New test suites:
argon2— RFC 9106 test vectors, algorithm variants, determinism, async/sync paritycertificate— valid/invalid SPKAC verification, public key and challenge exportcipherinfo— known ciphers (aes-256-cbc, aes-128-gcm, chacha20-poly1305), custom key/IV lengthsecdh— convertKey roundtrips, compressed/uncompressed/hybrid formats, hex encodingkeys— KeyObject.from/toCryptoKey roundtrip with ECDSA P-256, raw key export verificationprime— generate/check sync and async, safe primes, bigint supportRelated
EVP_PKEY_get0_EC_KEYAPIs to OpenSSL 3.x parameter APIs