(data)
| 16 | // Test Sign/Verify RSASSA-PKCS1-v1_5 |
| 17 | { |
| 18 | async function test(data) { |
| 19 | const ec = new TextEncoder(); |
| 20 | const { publicKey, privateKey } = await subtle.generateKey({ |
| 21 | name: 'RSASSA-PKCS1-v1_5', |
| 22 | modulusLength: 1024, |
| 23 | publicExponent: new Uint8Array([1, 0, 1]), |
| 24 | hash: 'SHA-256' |
| 25 | }, true, ['sign', 'verify']); |
| 26 | |
| 27 | const signature = await subtle.sign({ |
| 28 | name: 'RSASSA-PKCS1-v1_5' |
| 29 | }, privateKey, ec.encode(data)); |
| 30 | |
| 31 | assert(await subtle.verify({ |
| 32 | name: 'RSASSA-PKCS1-v1_5' |
| 33 | }, publicKey, signature, ec.encode(data))); |
| 34 | } |
| 35 | |
| 36 | test('hello world').then(common.mustCall()); |
| 37 | } |
no test coverage detected
searching dependent graphs…