Initial commit
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
const jose = require('jose');
|
||||
|
||||
function retrieveSigningKeys(keys) {
|
||||
const keystore = jose.JWKS.asKeyStore({ keys }, { ignoreErrors: true });
|
||||
|
||||
return keystore.all({ use: 'sig' }).map((key) => {
|
||||
return {
|
||||
kid: key.kid,
|
||||
alg: key.alg,
|
||||
get publicKey() { return key.toPEM(false); },
|
||||
get rsaPublicKey() { return key.toPEM(false); },
|
||||
getPublicKey() { return key.toPEM(false); }
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
retrieveSigningKeys
|
||||
};
|
||||
Reference in New Issue
Block a user