How to use the ssh2.utils.parseKey function in ssh2

To help you get started, we’ve selected a few ssh2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kzwang / node-git-lfs / test / authenticator / basic.js View on Github external
it('should return undefined if signature not valid', function* () {
            var key = ssh_utils.parseKey(fs.readFileSync('./ssh/server.pri'));
            var algo = 'RSA-SHA1';
            var data = new Buffer('test');
            var sign = crypto.createSign(algo);
            sign.update(data);
            var sig = sign.sign(key.privateOrig, 'binary');
            var result = yield authenticator.checkSSHAuthorization(null, null, algo, data, sig);
            should.not.exist(result);
        });