Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Commit

Permalink
refactor(JWKSet): remove kid generation
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalDeiwos committed Aug 25, 2017
1 parent 200c62d commit ec31285
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/JWKSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ const fs = require('fs')
const JWK = require('./JWK')
const { DataError, OperationError } = require('./errors')

/**
* Random KID Generator
* @ignore
*/
function random (byteLen) {
let value = crypto.getRandomValues(new Uint8Array(byteLen))
return Buffer.from(value).toString('hex')
}

/**
* JWKSet
* @ignore
Expand Down Expand Up @@ -279,10 +270,7 @@ class JWKSet {

return cryptoKeyPromise
.then(({ privateKey, publicKey }) => [privateKey, publicKey])
.then(keys => {
let kid = random(8)
return Promise.all(keys.map(key => JWK.fromCryptoKey(key, { alg, kid })))
})
.then(keys => Promise.all(keys.map(key => JWK.fromCryptoKey(key, { alg }))))
.then(keys => {
this.keys = this.keys.concat(keys)
return keys
Expand Down

0 comments on commit ec31285

Please sign in to comment.