Skip to content

Commit

Permalink
Add a test for alias names for "createSign".
Browse files Browse the repository at this point in the history
Make sure that createSign('sha256') is a valid usage
of this method.
  • Loading branch information
gbrail committed Sep 1, 2017
1 parent 05558a9 commit 3784e8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions node10/node10tests/noderunner/test-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,15 @@ verStream.end('3');
verified = verStream.verify(certPem, s3);
assert.strictEqual(verified, true, 'sign and verify (stream)');

var s4 = crypto.createSign('sha256')
.update('Test123')
.sign(keyPem, 'buffer');
var verified = crypto.createVerify('sha256')
.update('Test')
.update('123')
.verify(certPem, s4);
assert.strictEqual(verified, true, 'sign and verify (buffer)');

function testCipher1(key) {
// Test encryption and decryption
var plaintext = 'Keep this a secret? No! Tell everyone about node.js!';
Expand Down

0 comments on commit 3784e8f

Please sign in to comment.