OLD | NEW |
1 Tests cypto.subtle.sign and crypto.subtle.verify | 1 Tests cypto.subtle.sign and crypto.subtle.verify |
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 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, null, data) threw exception T
ypeError: Invalid signature argument. | 6 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, null, data) threw exception T
ypeError: Invalid signature argument. |
7 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, 'a', data) threw exception Ty
peError: Invalid signature argument. | 7 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, 'a', data) threw exception Ty
peError: Invalid signature argument. |
8 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, [], data) threw exception Typ
eError: Invalid signature argument. | 8 PASS crypto.subtle.verify(hmacSha1, keys.hmacSha1, [], data) threw exception Typ
eError: Invalid signature argument. |
9 PASS crypto.subtle.sign({name: 'sha-1'}, keys.hmacSha1, data) threw exception No
tSupportedError: Algorithm: SHA-1: Unsupported operation. | 9 PASS crypto.subtle.sign({name: 'sha-1'}, keys.hmacSha1, data) threw exception No
tSupportedError: Algorithm: SHA-1: Unsupported operation. |
| 10 PASS crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, keys.hmacSha1, data) threw e
xception NotSupportedError: Algorithm: RSAES-PKCS1-v1_5: Unsupported operation. |
10 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, keys.hmacSha1,
data) threw exception NotSupportedError: key.algorithm does not match that of op
eration (HMAC's hash differs). | 11 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, keys.hmacSha1,
data) threw exception NotSupportedError: key.algorithm does not match that of op
eration (HMAC's hash differs). |
11 PASS crypto.subtle.sign({name: 'hmac'}, keys.hmacSha1, data) threw exception Typ
eError: Algorithm: HMAC: HmacParams: hash: Missing or not a dictionary. | 12 PASS crypto.subtle.sign({name: 'hmac'}, keys.hmacSha1, data) threw exception Typ
eError: Algorithm: HMAC: HmacParams: hash: Missing or not a dictionary. |
12 PASS crypto.subtle.sign({name: 'hmac', hash: 3}, keys.hmacSha1, data) threw exce
ption TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: Not an object. | 13 PASS crypto.subtle.sign({name: 'hmac', hash: 3}, keys.hmacSha1, data) threw exce
ption TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: Not an object. |
13 PASS crypto.subtle.sign({name: 'hmac', hash: null}, keys.hmacSha1, data) threw e
xception TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: Not an object. | 14 PASS crypto.subtle.sign({name: 'hmac', hash: null}, keys.hmacSha1, data) threw e
xception TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: Not an object. |
14 PASS crypto.subtle.sign({name: 'hmac', hash: {}}, keys.hmacSha1, data) threw exc
eption TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: name: Missing or
not a string. | 15 PASS crypto.subtle.sign({name: 'hmac', hash: {}}, keys.hmacSha1, data) threw exc
eption TypeError: Algorithm: HMAC: HmacParams: hash: Algorithm: name: Missing or
not a string. |
15 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'foo'}}, keys.hmacSha1, data
) threw exception NotSupportedError: Algorithm: HMAC: HmacParams: hash: Algorith
m: Unrecognized algorithm name. | 16 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'foo'}}, keys.hmacSha1, data
) threw exception NotSupportedError: Algorithm: HMAC: HmacParams: hash: Algorith
m: Unrecognized algorithm name. |
16 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'AES-CBC'}}, keys.hmacSha1,
data) threw exception NotSupportedError: Algorithm: HMAC: HmacParams: hash: Algo
rithm: AES-CBC: Unsupported operation. | 17 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'AES-CBC'}}, keys.hmacSha1,
data) threw exception NotSupportedError: Algorithm: HMAC: HmacParams: hash: Algo
rithm: AES-CBC: Unsupported operation. |
17 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5'}, keys.rsaSsaSha1, data) thre
w exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: hash: Missing
or not a dictionary. | 18 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5'}, keys.rsaSsaSha1, data) thre
w exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: hash: Missing
or not a dictionary. |
18 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: 3}, keys.rsaSsaSha1, d
ata) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: hash
: Algorithm: Not an object. | 19 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: 3}, keys.rsaSsaSha1, d
ata) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: hash
: Algorithm: Not an object. |
19 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: null}, keys.rsaSsaSha1
, data) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: h
ash: Algorithm: Not an object. | 20 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: null}, keys.rsaSsaSha1
, data) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: h
ash: Algorithm: Not an object. |
20 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {}}, keys.rsaSsaSha1,
data) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: has
h: Algorithm: name: Missing or not a string. | 21 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {}}, keys.rsaSsaSha1,
data) threw exception TypeError: Algorithm: RSASSA-PKCS1-v1_5: RsaSSaParams: has
h: Algorithm: name: Missing or not a string. |
21 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'foo'}}, keys.r
saSsaSha1, data) threw exception NotSupportedError: Algorithm: RSASSA-PKCS1-v1_5
: RsaSSaParams: hash: Algorithm: Unrecognized algorithm name. | 22 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'foo'}}, keys.r
saSsaSha1, data) threw exception NotSupportedError: Algorithm: RSASSA-PKCS1-v1_5
: RsaSSaParams: hash: Algorithm: Unrecognized algorithm name. |
22 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'AES-CBC'}}, ke
ys.rsaSsaSha1, data) threw exception NotSupportedError: Algorithm: RSASSA-PKCS1-
v1_5: RsaSSaParams: hash: Algorithm: AES-CBC: Unsupported operation. | 23 PASS crypto.subtle.sign({name: 'RSASSA-PKCS1-v1_5', hash: {name: 'AES-CBC'}}, ke
ys.rsaSsaSha1, data) threw exception NotSupportedError: Algorithm: RSASSA-PKCS1-
v1_5: RsaSSaParams: hash: Algorithm: AES-CBC: Unsupported operation. |
23 PASS signResult.byteLength is 17 | 24 PASS signResult.byteLength is 17 |
24 PASS verifyResult is true | 25 PASS verifyResult is true |
25 PASS verifyResult is false | 26 PASS verifyResult is false |
26 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, generatedHmacSh
a1Key, data) threw exception NotSupportedError: key.algorithm does not match tha
t of operation (HMAC's hash differs). | 27 PASS crypto.subtle.sign({name: 'hmac', hash: {name: 'sha-256'}}, generatedHmacSh
a1Key, data) threw exception NotSupportedError: key.algorithm does not match tha
t of operation (HMAC's hash differs). |
27 PASS crypto.subtle.sign(hmacSha1, generatedHmacSha1Key, data) did not throw exce
ption. | 28 PASS crypto.subtle.sign(hmacSha1, generatedHmacSha1Key, data) did not throw exce
ption. |
28 PASS successfullyParsed is true | 29 PASS successfullyParsed is true |
29 | 30 |
30 TEST COMPLETE | 31 TEST COMPLETE |
31 | 32 |
OLD | NEW |