OLD | NEW |
1 Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they c
an't be used with another algorithm. | 1 Test generating, importing and exporting RSA keys for RSA-OAEP. Test that they c
an't be used with another algorithm. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 Generating a key pair... | 6 Generating a key pair... |
7 PASS keyPair.toString() is '[object KeyPair]' | 7 PASS keyPair.toString() is '[object KeyPair]' |
8 PASS keyPair.publicKey.type is 'public' | 8 PASS keyPair.publicKey.type is 'public' |
9 PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP' | 9 PASS keyPair.publicKey.algorithm.name is 'RSA-OAEP' |
10 PASS keyPair.publicKey.algorithm.modulusLength is 2048 | 10 PASS keyPair.publicKey.algorithm.modulusLength is 512 |
11 PASS keyPair.publicKey.usages is ["encrypt", "wrapKey"] | 11 PASS keyPair.publicKey.usages is ["encrypt", "wrapKey"] |
12 PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' | 12 PASS bytesToHexString(keyPair.publicKey.algorithm.publicExponent) is '010001' |
13 PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1' | 13 PASS keyPair.publicKey.algorithm.hash.name is 'SHA-1' |
14 PASS keyPair.privateKey.type is 'private' | 14 PASS keyPair.privateKey.type is 'private' |
15 PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP' | 15 PASS keyPair.privateKey.algorithm.name is 'RSA-OAEP' |
16 PASS keyPair.privateKey.algorithm.modulusLength is 2048 | 16 PASS keyPair.privateKey.algorithm.modulusLength is 512 |
17 PASS keyPair.privateKey.usages is ["decrypt", "unwrapKey"] | 17 PASS keyPair.privateKey.usages is ["decrypt", "unwrapKey"] |
18 PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' | 18 PASS bytesToHexString(keyPair.privateKey.algorithm.publicExponent) is '010001' |
19 PASS keyPair.privateKey.algorithm.hash.name is 'SHA-1' | 19 PASS keyPair.privateKey.algorithm.hash.name is 'SHA-1' |
20 | 20 |
21 Testing that the keys can't be used with different algorithms... | 21 Testing that the keys can't be used with different algorithms... |
22 error is: InvalidAccessError: key.usages does not permit this operation | 22 error is: InvalidAccessError: key.usages does not permit this operation |
23 error is: InvalidAccessError: key.algorithm does not match that of operation | 23 error is: InvalidAccessError: key.algorithm does not match that of operation |
24 | 24 |
25 Trying to export keys to raw... | 25 Trying to export keys to raw... |
26 error is: InvalidAccessError: The key is not of the expected type | 26 error is: InvalidAccessError: The key is not of the expected type |
27 PASS Promise rejected for exporting public key | 27 PASS Promise rejected for exporting public key |
28 error is: InvalidAccessError: The key is not of the expected type | 28 error is: InvalidAccessError: The key is not of the expected type |
29 PASS Promise rejected for exporting private key | 29 PASS Promise rejected for exporting private key |
30 | 30 |
31 Exporting public key to JWK... | 31 Exporting public key to JWK... |
32 PASS jwkPublicKey.alg is 'RSA-OAEP' | 32 PASS jwkPublicKey.alg is 'RSA-OAEP' |
33 PASS jwkPublicKey.ext is true | 33 PASS jwkPublicKey.ext is true |
34 PASS jwkPublicKey.key_ops is ['encrypt', 'wrapKey'] | 34 PASS jwkPublicKey.key_ops is ['encrypt', 'wrapKey'] |
35 PASS jwkPublicKey.use is undefined | 35 PASS jwkPublicKey.use is undefined |
36 PASS jwkPublicKey.kty is 'RSA' | 36 PASS jwkPublicKey.kty is 'RSA' |
37 PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001' | 37 PASS bytesToHexString(Base64URL.parse(jwkPublicKey.e)) is '010001' |
38 | 38 |
39 Importing it back... | 39 Importing it back... |
40 PASS exportedPublicKey.type is 'public' | 40 PASS exportedPublicKey.type is 'public' |
41 PASS exportedPublicKey.algorithm.name is 'RSA-OAEP' | 41 PASS exportedPublicKey.algorithm.name is 'RSA-OAEP' |
42 PASS exportedPublicKey.algorithm.modulusLength is 2048 | 42 PASS exportedPublicKey.algorithm.modulusLength is 512 |
43 PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001' | 43 PASS bytesToHexString(exportedPublicKey.algorithm.publicExponent) is '010001' |
44 PASS exportedPublicKey.algorithm.hash.name is 'SHA-1' | 44 PASS exportedPublicKey.algorithm.hash.name is 'SHA-1' |
45 PASS exportedPublicKey.extractable is true | 45 PASS exportedPublicKey.extractable is true |
46 PASS exportedPublicKey.usages is ['encrypt','wrapKey'] | 46 PASS exportedPublicKey.usages is ['encrypt','wrapKey'] |
47 PASS successfullyParsed is true | 47 PASS successfullyParsed is true |
48 | 48 |
49 TEST COMPLETE | 49 TEST COMPLETE |
50 | 50 |
OLD | NEW |