(allowKeyObject, bufferOnly = false)
| 531 | } |
| 532 | |
| 533 | function getKeyTypes(allowKeyObject, bufferOnly = false) { |
| 534 | const types = [ |
| 535 | 'ArrayBuffer', |
| 536 | 'Buffer', |
| 537 | 'TypedArray', |
| 538 | 'DataView', |
| 539 | 'string', // Only if bufferOnly == false |
| 540 | 'KeyObject', // Only if allowKeyObject == true && bufferOnly == false |
| 541 | 'CryptoKey', // Only if allowKeyObject == true && bufferOnly == false |
| 542 | ]; |
| 543 | if (bufferOnly) { |
| 544 | return ArrayPrototypeSlice(types, 0, 4); |
| 545 | } else if (!allowKeyObject) { |
| 546 | return ArrayPrototypeSlice(types, 0, 5); |
| 547 | } |
| 548 | return types; |
| 549 | } |
| 550 | |
| 551 | |
| 552 | function prepareAsymmetricKey(key, ctx, name = 'key') { |
no outgoing calls
no test coverage detected
searching dependent graphs…