( format, keyData, algorithm, extractable, keyUsages)
| 991 | } |
| 992 | |
| 993 | function importKeyImpl( |
| 994 | format, |
| 995 | keyData, |
| 996 | algorithm, |
| 997 | extractable, |
| 998 | keyUsages) { |
| 999 | const prefix = prepareSubtleMethod(this, 'importKey', arguments.length, 5); |
| 1000 | let i = 0; |
| 1001 | format = convertSubtleArgument(prefix, 'KeyFormat', format, i++); |
| 1002 | const type = format === 'jwk' ? 'JsonWebKey' : 'BufferSource'; |
| 1003 | keyData = convertSubtleArgument(prefix, type, keyData, i++); |
| 1004 | algorithm = convertSubtleArgument( |
| 1005 | prefix, 'AlgorithmIdentifier', algorithm, i++); |
| 1006 | extractable = convertSubtleArgument(prefix, 'boolean', extractable, i++); |
| 1007 | const usages = convertSubtleArgument( |
| 1008 | prefix, 'sequence<KeyUsage>', keyUsages, i++); |
| 1009 | |
| 1010 | const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'importKey'); |
| 1011 | |
| 1012 | return FunctionPrototypeCall( |
| 1013 | importKeySync, |
| 1014 | this, |
| 1015 | format, |
| 1016 | keyData, |
| 1017 | normalizedAlgorithm, |
| 1018 | extractable, |
| 1019 | usages, |
| 1020 | ); |
| 1021 | } |
| 1022 | |
| 1023 | // subtle.wrapKey() is essentially a subtle.exportKey() followed |
| 1024 | // by a subtle.encrypt(). |
nothing calls this directly
no test coverage detected
searching dependent graphs…