blob: f4163eed3921900181cfa26abe3634e67ad8293b [file] [log] [blame]
Test importing a RSA key with malformed parameters
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "sig"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: "enc"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, use: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "foo"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS224"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS256"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-224"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS384"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-256"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS512"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-384"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RS1"}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-512"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-224"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-256"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-384"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSASSA-PKCS1-v1_5", hash: "sha-512"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RSA-OAEP-224"}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RSA-OAEP-256"}, {name: "RSA-OAEP", hash: "sha-224"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RSA-OAEP-384"}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RSA-OAEP-512"}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "RSA-OAEP"}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-224"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-256"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-384"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-OAEP", hash: "sha-512"}, extractable, ["encrypt", "wrapKey"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS224"}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS256"}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS384"}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS512"}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: "PS1"}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-224"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-256"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-384"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, alg: ""}, {name: "RSA-PSS", hash: "sha-512"}, extractable, ["verify"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "oct", n: n, e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: ["sign", "verify"]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, key_ops: [ ]}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, ext: false}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA"}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", e: e}, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq, qi: qi, oth: [{r: q, d: dq, t: qi}]}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, q: q, dp: dp, dq: dq, qi: qi}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: p, dp: dp, dq: dq, qi: qi}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: p, q: q, dq: dq, qi: qi}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: p, q: q, dp: dp, qi: qi}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: p, q: q, dp: dp, dq: dq}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("jwk", {kty: "RSA", n: n, e: e, d: d, p: "", q: q, dp: dp, dq: dq, qi: qi}, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("spki", spkiKey, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["sign"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["decrypt", "unwrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("spki", spkiKey, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["sign"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSASSA-PKCS1-v1_5", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-OAEP", hash: "sha-1"}, extractable, ["encrypt", "wrapKey"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("pkcs8", pkcs8Key, {name: "RSA-PSS", hash: "sha-1"}, extractable, ["verify"]) rejected promise with SyntaxError: A required parameter was missing or out-of-range.
PASS crypto.subtle.importKey("spki", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("spki", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("spki", malformedKey2, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("spki", malformedKey4, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("spki", malformedKey6, "RSAES-PKCS1-v1_5", extractable, ["encrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("pkcs8", malformedKey0, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("pkcs8", malformedKey1, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("pkcs8", malformedKey3, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("pkcs8", malformedKey5, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS crypto.subtle.importKey("pkcs8", malformedKey7, "RSAES-PKCS1-v1_5", extractable, ["decrypt"]) rejected promise with DataError: Data provided to an operation does not meet requirements.
PASS successfullyParsed is true
TEST COMPLETE