(key, extractable)
| 67 | } |
| 68 | |
| 69 | async _importKey(key, extractable) { |
| 70 | const n = key.n; |
| 71 | const e = key.e; |
| 72 | if (n.length !== e.length) { |
| 73 | throw new Error("the sizes of modulus and public exponent do not match"); |
| 74 | } |
| 75 | this._keyBytes = n.length; |
| 76 | this._keyLength = this._keyBytes * 8; |
| 77 | this._n = new Uint8Array(this._keyBytes); |
| 78 | this._e = new Uint8Array(this._keyBytes); |
| 79 | this._n.set(n); |
| 80 | this._e.set(e); |
| 81 | this._nBigInt = u8ArrayToBigInt(this._n); |
| 82 | this._eBigInt = u8ArrayToBigInt(this._e); |
| 83 | this._extractable = extractable; |
| 84 | } |
| 85 | |
| 86 | async encrypt(_algorithm, message) { |
| 87 | if (message.length > this._keyBytes - 11) { |
no test coverage detected