* Derives a public CryptoKey from a private CryptoKey. The resulting key uses * the private key's algorithm, is extractable, and validates the requested * public usages through the shared asymmetric import path. * @param {CryptoKey} key * @param {string[]} keyUsages * @returns {CryptoKey}
(key, keyUsages)
| 832 | * @returns {CryptoKey} |
| 833 | */ |
| 834 | function toPublicCryptoKey(key, keyUsages) { |
| 835 | const handle = new KeyObjectHandle(); |
| 836 | handle.init(kKeyTypePublic, getCryptoKeyHandle(key), |
| 837 | null, null, null, null); |
| 838 | return toCryptoKey( |
| 839 | handle, |
| 840 | getCryptoKeyAlgorithm(key), |
| 841 | true, |
| 842 | keyUsages); |
| 843 | } |
| 844 | |
| 845 | function createPrivateKey(key) { |
| 846 | const { format, type, data, passphrase, namedCurve } = |
no test coverage detected
searching dependent graphs…