(keyData, isPublic)
| 130 | } |
| 131 | |
| 132 | function importDerKey(keyData, isPublic) { |
| 133 | const handle = new KeyObjectHandle(); |
| 134 | const keyType = isPublic ? kKeyTypePublic : kKeyTypePrivate; |
| 135 | const encoding = isPublic ? kKeyEncodingSPKI : kKeyEncodingPKCS8; |
| 136 | try { |
| 137 | handle.init(keyType, keyData, kKeyFormatDER, encoding, null, null); |
| 138 | } catch (err) { |
| 139 | throw lazyDOMException( |
| 140 | 'Invalid keyData', { name: 'DataError', cause: err }); |
| 141 | } |
| 142 | return handle; |
| 143 | } |
| 144 | |
| 145 | function validateJwk(keyData, kty, extractable, usagesSet, expectedUse) { |
| 146 | if (typeof keyData.kty !== 'string') |
no test coverage detected
searching dependent graphs…