function Credentials(secureProtocol, flags, context) {
if (!(this instanceof Credentials)) {
- return new Credentials(secureProtocol);
+ return new Credentials(secureProtocol, flags, context);
}
if (!crypto) {
exports.createHash = exports.Hash = Hash;
function Hash(algorithm, options) {
if (!(this instanceof Hash))
- return new Hash(algorithm);
+ return new Hash(algorithm, options);
this._binding = new binding.Hash(algorithm);
LazyTransform.call(this, options);
}
function Hmac(hmac, key, options) {
if (!(this instanceof Hmac))
- return new Hmac(hmac, key);
+ return new Hmac(hmac, key, options);
this._binding = new binding.Hmac();
this._binding.init(hmac, toBuf(key));
LazyTransform.call(this, options);
exports.createCipher = exports.Cipher = Cipher;
function Cipher(cipher, password, options) {
if (!(this instanceof Cipher))
- return new Cipher(cipher, password);
+ return new Cipher(cipher, password, options);
this._binding = new binding.Cipher;
this._binding.init(cipher, toBuf(password));
exports.createCipheriv = exports.Cipheriv = Cipheriv;
function Cipheriv(cipher, key, iv, options) {
if (!(this instanceof Cipheriv))
- return new Cipheriv(cipher, key, iv);
+ return new Cipheriv(cipher, key, iv, options);
this._binding = new binding.Cipher();
this._binding.initiv(cipher, toBuf(key), toBuf(iv));
this._decoder = null;
exports.createDecipher = exports.Decipher = Decipher;
function Decipher(cipher, password, options) {
if (!(this instanceof Decipher))
- return new Decipher(cipher, password);
+ return new Decipher(cipher, password, options);
this._binding = new binding.Decipher;
this._binding.init(cipher, toBuf(password));
exports.createDecipheriv = exports.Decipheriv = Decipheriv;
function Decipheriv(cipher, key, iv, options) {
if (!(this instanceof Decipheriv))
- return new Decipheriv(cipher, key, iv);
+ return new Decipheriv(cipher, key, iv, options);
this._binding = new binding.Decipher;
this._binding.initiv(cipher, toBuf(key), toBuf(iv));
exports.createSign = exports.Sign = Sign;
function Sign(algorithm, options) {
if (!(this instanceof Sign))
- return new Sign(algorithm);
+ return new Sign(algorithm, options);
this._binding = new binding.Sign();
this._binding.init(algorithm);
exports.createVerify = exports.Verify = Verify;
function Verify(algorithm, options) {
if (!(this instanceof Verify))
- return new Verify(algorithm);
+ return new Verify(algorithm, options);
this._binding = new binding.Verify;
this._binding.init(algorithm);