|
@ -3599,17 +3599,24 @@ try { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Credentials(method) { |
|
|
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); |
|
|
if (cred.key) c.context.setKey(cred.key); |
|
|
if (cred.key) c.context.setKey(cred.key); |
|
@ -3631,45 +3638,54 @@ 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); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
exports.Verify = Verify; |
|
|
exports.Verify = Verify; |
|
|
exports.createVerify = function(algorithm) { |
|
|
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; |
|
|