(key)
| 189 | } |
| 190 | |
| 191 | static from(key) { |
| 192 | if (!isCryptoKey(key)) |
| 193 | throw new ERR_INVALID_ARG_TYPE('key', 'CryptoKey', key); |
| 194 | maybeEmitDEP0204(key); |
| 195 | const handle = getCryptoKeyHandle(key); |
| 196 | switch (getCryptoKeyType(key)) { |
| 197 | /* eslint-disable no-use-before-define */ |
| 198 | case 'secret': return new SecretKeyObject(handle); |
| 199 | case 'public': return new PublicKeyObject(handle); |
| 200 | case 'private': return new PrivateKeyObject(handle); |
| 201 | /* eslint-enable no-use-before-define */ |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | equals(otherKeyObject) { |
| 206 | if (!isKeyObject(otherKeyObject)) { |
no test coverage detected