/third_party/node/test/parallel/ |
D | test-crypto-keygen.js | 36 function testEncryptDecrypt(publicKey, privateKey) { argument 39 for (const key of [publicKey, privateKey]) { 41 const received = privateDecrypt(privateKey, ciphertext); 47 function testSignVerify(publicKey, privateKey) { argument 59 const signature = signFn('SHA256', message, privateKey); 61 for (const key of [publicKey, privateKey]) { 105 const { publicKey, privateKey } = ret; 110 assert.strictEqual(typeof privateKey, 'string'); 111 assert.match(privateKey, pkcs8Exp); 112 assertApproximateSize(privateKey, 512); [all …]
|
D | test-crypto-key-objects.js | 113 const privateKey = createPrivateKey(privatePem); constant 114 assert.throws(() => createPrivateKey(privateKey), { 158 const privateKey = createPrivateKey(privatePem); constant 159 assert.strictEqual(privateKey.type, 'private'); 160 assert.strictEqual(privateKey.toString(), '[object KeyObject]'); 161 assert.strictEqual(privateKey.asymmetricKeyType, 'rsa'); 162 assert.strictEqual(privateKey.symmetricKeySize, undefined); 165 const derivedPublicKey = createPublicKey(privateKey); 178 assert.strictEqual(privateKey.type, 'private'); 179 assert.strictEqual(privateKey.toString(), '[object KeyObject]'); [all …]
|
D | test-webcrypto-derivebits-ecdh.js | 56 privateKey, 79 privateKey, property 93 const { size, result, privateKey, publicKey } = keys[namedCurve]; 100 }, privateKey, 8 * size); 111 }, privateKey, 8 * size); 121 }, privateKey, null); 131 }, privateKey, 8 * size - 32); 143 }, privateKey, 8 * size + 8), { 153 }, privateKey, 8 * size - 11); 167 keys['P-384'].privateKey, [all …]
|
D | test-webcrypto-keygen.js | 264 const { publicKey, privateKey } = await subtle.generateKey({ 272 assert(privateKey); 274 assert(isCryptoKey(privateKey)); 277 assert(privateKey instanceof CryptoKey); 280 assert.strictEqual(privateKey.type, 'private'); 282 assert.strictEqual(privateKey.toString(), '[object CryptoKey]'); 284 assert.strictEqual(privateKey.extractable, true); 286 assert.deepStrictEqual(privateKey.usages, privateUsages); 294 assert.strictEqual(privateKey.algorithm.name, name); 295 assert.strictEqual(privateKey.algorithm.modulusLength, modulusLength); [all …]
|
D | test-webcrypto-derivebits-cfrg.js | 41 privateKey, 58 privateKey, property 72 const { size, result, privateKey, publicKey } = keys[name]; 79 }, privateKey, 8 * size); 90 }, privateKey, 8 * size); 100 }, privateKey, null); 110 }, privateKey, 8 * size - 32); 122 }, privateKey, 8 * size + 8), { 132 }, privateKey, 8 * size - 11); 146 keys.X448.privateKey, [all …]
|
D | test-webcrypto-derivekey-ecdh.js | 51 privateKey, 74 privateKey, property 92 const { result, privateKey, publicKey } = keys[namedCurve]; 99 }, privateKey, ...otherArgs); 111 }, privateKey, { 129 keys['P-384'].privateKey, 142 keys['P-384'].privateKey, 155 keys['P-521'].privateKey, 176 keys['P-521'].privateKey, 183 const privateKey = await subtle.importKey( [all …]
|
D | test-crypto-async-sign-verify.js | 20 let privateKey = crypto.createPrivateKey(privatePem); 23 key: privateKey.export({ format: 'der', type: 'pkcs8' }), 38 privateKey = { ...options, key: privateKey }; variable 43 const expected = crypto.sign(algorithm, data, privateKey); 45 for (const key of [privatePem, privateKey, privateDer]) { 57 publicPem, publicKey, publicDer, privatePem, privateKey, privateDer]; 120 const privateKey = { variable 132 sign('sha256', data, privateKey), 133 sign('sha256', data, privateKey), 134 sign('sha256', data, privateKey),
|
D | test-webcrypto-derivekey-cfrg.js | 40 privateKey, 57 privateKey, property 75 const { result, privateKey, publicKey } = keys[name]; 82 }, privateKey, ...otherArgs); 94 }, privateKey, { 112 keys.X448.privateKey, 125 keys.X448.privateKey, 138 keys.X448.privateKey, 162 public: keys.X448.privateKey 164 keys.X448.privateKey,
|
D | test-webcrypto-sign-verify.js | 18 const { publicKey, privateKey } = await subtle.generateKey({ 27 }, privateKey, ec.encode(data)); 41 const { publicKey, privateKey } = await subtle.generateKey({ 51 }, privateKey, ec.encode(data)); 66 const { publicKey, privateKey } = await subtle.generateKey({ 74 }, privateKey, ec.encode(data)); 112 const { publicKey, privateKey } = await subtle.generateKey({ 118 }, privateKey, ec.encode(data)); 132 const { publicKey, privateKey } = await subtle.generateKey({ 138 }, privateKey, ec.encode(data));
|
D | test-crypto-dh-stateless.js | 29 function test({ publicKey: alicePublicKey, privateKey: alicePrivateKey }, property 30 { publicKey: bobPublicKey, privateKey: bobPrivateKey }, property 33 privateKey: alicePrivateKey, property 37 privateKey: bobPrivateKey, property 105 assert.throws(() => crypto.diffieHellman({ privateKey: alicePrivateKey }), { property 117 const privateKey = Buffer.from( constant 134 dh.setPrivateKey(privateKey); 137 test({ publicKey: alicePublicKey, privateKey: alicePrivateKey }, property 138 { publicKey: bobPublicKey, privateKey: bobPrivateKey }, property 173 const privateKey = crypto.createPrivateKey({ constant [all …]
|
D | test-webcrypto-encrypt-decrypt-rsa.js | 22 const [publicKey, privateKey] = await Promise.all([ 29 return { publicKey, privateKey }; 42 privateKey 52 const result = await subtle.decrypt(algorithm, privateKey, ciphertext); 61 const result2 = await subtle.decrypt(algorithm, privateKey, ciphercopy); 81 privateKey 101 privateKey.algorithm.modulusLength); 103 const out = await subtle.decrypt(algorithm, privateKey, result); 140 privateKey, 149 subtle.encrypt(algorithm, privateKey, plaintext), {
|
D | test-webcrypto-sign-verify-eddsa.js | 21 privateKey, 78 subtle.verify({ name }, privateKey, signature, data), { 134 privateKey, 174 const sig = await subtle.sign({ name }, privateKey, data); 181 const p = subtle.sign({ name }, privateKey, copy); 200 subtle.sign({ name }, rsaKeys.privateKey, data), { 205 subtle.sign({ name }, ecKeys.privateKey, data), { 237 ]).then(async ([privateKey, publicKey]) => { 238 …const sig = await subtle.sign({ name: 'Ed448', context: Buffer.alloc(0) }, privateKey, vector.data… 243 …await assert.rejects(subtle.sign({ name: 'Ed448', context: Buffer.alloc(1) }, privateKey, vector.d…
|
D | test-webcrypto-sign-verify-ecdsa.js | 23 privateKey, 79 subtle.verify({ name, hash }, privateKey, signature, plaintext), { 152 privateKey, 191 const sig = await subtle.sign({ name, hash }, privateKey, plaintext); 198 const p = subtle.sign({ name, hash }, privateKey, copy); 217 subtle.sign({ name, hash }, rsaKeys.privateKey, plaintext), { 222 subtle.sign({ name, hash }, okpKeys.privateKey, plaintext), {
|
D | test-crypto-keygen-deprecation.js | 30 }, common.mustSucceed((publicKey, privateKey) => { 41 assert.strictEqual(privateKey.type, 'private'); 42 assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss'); 43 assert.deepStrictEqual(privateKey.asymmetricKeyDetails, {
|
D | test-webcrypto-sign-verify-rsa.js | 25 privateKey, 73 subtle.verify(algorithm, privateKey, signature, plaintext), { 135 privateKey, 166 const sig = await subtle.sign(algorithm, privateKey, plaintext); 173 const p = subtle.sign(algorithm, privateKey, copy); 192 subtle.sign(algorithm, ecdsaKeys.privateKey, plaintext), {
|
D | test-webcrypto-export-import.js | 161 const { publicKey, privateKey } = await subtle.generateKey({ 175 subtle.exportKey('pkcs8', privateKey), 177 subtle.exportKey('jwk', privateKey), 221 const { publicKey, privateKey } = await subtle.generateKey({ 233 subtle.exportKey('pkcs8', privateKey), 235 subtle.exportKey('jwk', privateKey),
|
D | test-webcrypto-export-import-rsa.js | 385 privateKey, 407 assert.strictEqual(privateKey.type, 'private'); 409 assert.strictEqual(privateKey.extractable, extractable); 411 assert.strictEqual(privateKey.algorithm.name, name); 413 assert.strictEqual(privateKey.algorithm.modulusLength, size); 417 privateKey.algorithm.publicExponent); 425 subtle.exportKey('jwk', privateKey), 452 subtle.exportKey('jwk', privateKey), {
|
/third_party/node/benchmark/crypto/ |
D | oneshot-sign.js | 34 function measureSync(n, digest, privateKey, keys) { argument 40 privateKey || keys[i]); 45 function measureAsync(n, digest, privateKey, keys) { argument 58 privateKey || keys[n - remaining], 65 function measureAsyncParallel(n, digest, privateKey, keys) { argument 76 privateKey || keys[i], 85 let privateKey, keys, digest; 100 privateKey = keyObjects[0]; 103 privateKey = pems[0]; 106 privateKey = { key: keyObjects[0].export({ format: 'jwk' }), format: 'jwk' }; variable [all …]
|
D | create-keyobject.js | 16 privateKey: readKey(privateKeyName), 43 privateKey: crypto.createPrivateKey(keyFixtures[keyType].privateKey), property 53 key = keyPair.privateKey.export({ format: 'pem', type: 'pkcs8' }); 64 key = { ...options, key: keyPair.privateKey.export(options) }; 76 key = { ...options, key: keyPair.privateKey.export(options) };
|
/third_party/node/test/fixtures/wpt/WebCryptoAPI/encrypt_decrypt/ |
D | rsa_vectors.js | 47 privateKey: null, property 60 privateKey: null, property 73 privateKey: null, property 86 privateKey: null, property 99 privateKey: null, property 112 privateKey: null, property 125 privateKey: null, property 138 privateKey: null, property 151 privateKey: null, property 164 privateKey: null, property [all …]
|
D | rsa.js | 24 return subtle.decrypt(vector.algorithm, vector.privateKey, vector.ciphertext) 54 var operation = subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext) 136 …assert_equals(ciphertext.byteLength * 8, vector.privateKey.algorithm.modulusLength, "Ciphertext le… 138 return subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext) 180 …assert_equals(ciphertext.byteLength * 8, vector.privateKey.algorithm.modulusLength, "Ciphertext le… 183 return subtle.decrypt(vector.algorithm, vector.privateKey, ciphertext) 249 return subtle.encrypt(vector.algorithm, vector.privateKey, vector.plaintext) 333 if (vector.privateKey !== null) { 340 vector.privateKey = key;
|
/third_party/node/test/fixtures/crypto/ |
D | rsa.js | 173 privateKey: null, property 186 privateKey: null, property 199 privateKey: null, property 212 privateKey: null, property 225 privateKey: null, property 238 privateKey: null, property 251 privateKey: null, property 264 privateKey: null, property 277 privateKey: null, property 290 privateKey: null, property [all …]
|
/third_party/node/test/fixtures/wpt/WebCryptoAPI/sign_verify/ |
D | rsa_pss_vectors.js | 44 privateKey: null, property 57 privateKey: null, property 70 privateKey: null, property 83 privateKey: null, property 96 privateKey: null, property 109 privateKey: null, property 122 privateKey: null, property 135 privateKey: null, property
|
D | rsa_pkcs_vectors.js | 40 privateKey: null, property 53 privateKey: null, property 66 privateKey: null, property 79 privateKey: null, property
|
/third_party/node/test/common/ |
D | crypto.js | 28 function testDH({ publicKey: alicePublicKey, privateKey: alicePrivateKey }, property 29 { publicKey: bobPublicKey, privateKey: bobPrivateKey }, property 32 privateKey: alicePrivateKey, property 36 privateKey: bobPrivateKey, property
|