Incorrect type declaration for CryptoKeyPair
See original GitHub issueBug Report
🔎 Search Terms
WebCrypto, CryptoKeyPair
🕗 Version & Regression Information
- This changed between versions 4.3 and 4.4
Description
Here is W3C spec for CryptoKeyPair dictionary.
In TS v4.4.3 type declaration for CryptoKeyPair is:
interface CryptoKeyPair {
privateKey?: CryptoKey;
publicKey?: CryptoKey;
}
In TS v.4.3.5:
interface CryptoKeyPair {
privateKey: CryptoKey;
publicKey: CryptoKey;
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
CryptoKeyPair - Web APIs - MDN Web Docs
A CryptoKey object representing the private key. For encryption and decryption algorithms, this key is used to decrypt. For signing and ...
Read more >Web Cryptography API - W3C
Abstract. This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, ...
Read more >How to use Jest to test functions using crypto or window ...
Use the following code to set up the crypto property globally. It will allow Jest to access. window.crypto in the browser environment ...
Read more >CryptoKey - Web APIs
Chrome Edge Firefox Internet...
CryptoKey Chrome Full support 37 Edge Full support ≤18 Firefox Full support 34 IE No s...
algorithm Chrome Full support 37...
Read more >SubtleCrypto.generateKey()
algorithm is a dictionary object defining the type of key to generate and ... algorithms) or a CryptoKeyPair (for public-key algorithms).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also filed https://github.com/w3c/webcrypto/issues/290.
Hmm, given that
CryptoKeyPair
is only used as the return value ofgenerateKey()
and the algorithm always sets both fields together, I guess it’s right to set them as non-optional. I’ll go reopen the PR.