feat: replace lib multihashing with multihashing-async

This commit is contained in:
nikuda
2016-10-03 23:15:21 +11:00
committed by Friedel Ziegelmayer
parent cecadba14d
commit b088bab80f
21 changed files with 452 additions and 31388 deletions

View File

@ -1,6 +1,6 @@
'use strict'
const multihashing = require('multihashing')
const multihashing = require('multihashing-async')
const protobuf = require('protocol-buffers')
const crypto = require('../crypto').rsa
@ -17,7 +17,7 @@ class RsaPublicKey {
}
marshal () {
return this._key
return crypto.jwkToPkix(this._key)
}
get bytes () {
@ -103,7 +103,9 @@ function unmarshalRsaPrivateKey (bytes, callback) {
}
function unmarshalRsaPublicKey (bytes) {
return new RsaPublicKey(bytes)
const jwk = crypto.pkixToJwk(bytes)
return new RsaPublicKey(jwk)
}
function generateKeyPair (bits, cb) {