|
@ -3603,12 +3603,19 @@ function Credentials(method) { |
|
|
if (!crypto) { |
|
|
if (!crypto) { |
|
|
throw new Error('node.js not compiled with openssl crypto support.'); |
|
|
throw new Error('node.js not compiled with openssl crypto support.'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.context = new SecureContext(); |
|
|
this.context = new SecureContext(); |
|
|
if (method) this.context.init(method); |
|
|
|
|
|
else this.context.init(); |
|
|
if (method) { |
|
|
|
|
|
this.context.init(method); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.context.init(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.shouldVerify = false; |
|
|
this.shouldVerify = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.createCredentials = function (cred) { |
|
|
exports.createCredentials = function (cred) { |
|
|
if (!cred) cred={}; |
|
|
if (!cred) cred={}; |
|
|
var c = new Credentials(cred.method); |
|
|
var c = new Credentials(cred.method); |
|
@ -3631,34 +3638,41 @@ exports.createCredentials = function(cred) { |
|
|
}; |
|
|
}; |
|
|
exports.Credentials = Credentials; |
|
|
exports.Credentials = Credentials; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.Hash = Hash; |
|
|
exports.Hash = Hash; |
|
|
exports.createHash = function (hash) { |
|
|
exports.createHash = function (hash) { |
|
|
return new Hash(hash); |
|
|
return new Hash(hash); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.Hmac = Hmac; |
|
|
exports.Hmac = Hmac; |
|
|
exports.createHmac = function (hmac, key) { |
|
|
exports.createHmac = function (hmac, key) { |
|
|
return (new Hmac).init(hmac, key); |
|
|
return (new Hmac).init(hmac, key); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.Cipher = Cipher; |
|
|
exports.Cipher = Cipher; |
|
|
exports.createCipher = function (cipher, key) { |
|
|
exports.createCipher = function (cipher, key) { |
|
|
return (new Cipher).init(cipher, key); |
|
|
return (new Cipher).init(cipher, key); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.createCipheriv = function (cipher, key, iv) { |
|
|
exports.createCipheriv = function (cipher, key, iv) { |
|
|
return (new Cipher).initiv(cipher, key, iv); |
|
|
return (new Cipher).initiv(cipher, key, iv); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.Decipher = Decipher; |
|
|
exports.Decipher = Decipher; |
|
|
exports.createDecipher = function (cipher, key) { |
|
|
exports.createDecipher = function (cipher, key) { |
|
|
return (new Decipher).init(cipher, key); |
|
|
return (new Decipher).init(cipher, key); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.createDecipheriv = function (cipher, key, iv) { |
|
|
exports.createDecipheriv = function (cipher, key, iv) { |
|
|
return (new Decipher).initiv(cipher, key, iv); |
|
|
return (new Decipher).initiv(cipher, key, iv); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.Sign = Sign; |
|
|
exports.Sign = Sign; |
|
|
exports.createSign = function (algorithm) { |
|
|
exports.createSign = function (algorithm) { |
|
|
return (new Sign).init(algorithm); |
|
|
return (new Sign).init(algorithm); |
|
@ -3669,7 +3683,9 @@ exports.createVerify = function(algorithm) { |
|
|
return (new Verify).init(algorithm); |
|
|
return (new Verify).init(algorithm); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.RootCaCerts = RootCaCerts; |
|
|
exports.RootCaCerts = RootCaCerts; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var securepair = require('securepair'); |
|
|
var securepair = require('securepair'); |
|
|
exports.createPair = securepair.createSecurePair; |
|
|
exports.createPair = securepair.createSecurePair; |
|
|