(key, format)
| 147 | } |
| 148 | |
| 149 | function rsaExportKey(key, format) { |
| 150 | try { |
| 151 | switch (format) { |
| 152 | case kWebCryptoKeyFormatSPKI: { |
| 153 | return TypedArrayPrototypeGetBuffer( |
| 154 | getCryptoKeyHandle(key).export(kKeyFormatDER, kWebCryptoKeyFormatSPKI)); |
| 155 | } |
| 156 | case kWebCryptoKeyFormatPKCS8: { |
| 157 | return TypedArrayPrototypeGetBuffer( |
| 158 | getCryptoKeyHandle(key).export(kKeyFormatDER, kWebCryptoKeyFormatPKCS8, null, null)); |
| 159 | } |
| 160 | default: |
| 161 | return undefined; |
| 162 | } |
| 163 | } catch (err) { |
| 164 | throw lazyDOMException( |
| 165 | 'The operation failed for an operation-specific reason', |
| 166 | { name: 'OperationError', cause: err }); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | function rsaImportKey( |
| 171 | format, |
nothing calls this directly
no test coverage detected
searching dependent graphs…