keypair: minor.

This commit is contained in:
Christopher Jeffrey 2016-07-30 18:24:45 -07:00
parent 7ec21588ac
commit f8c3f37f0c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -291,7 +291,9 @@ KeyPair.prototype.fromSecret = function fromSecret(secret) {
* @returns {KeyPair}
*/
KeyPair.fromRaw = function fromRaw(data) {
KeyPair.fromRaw = function fromRaw(data, enc) {
if (typeof data === 'string')
data = new Buffer(data, enc);
return new KeyPair().fromRaw(data);
};