Initial commit

This commit is contained in:
talksik
2021-12-29 01:57:42 -08:00
commit ce39a60b42
4634 changed files with 997667 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
const { inspect } = require('util')
const Key = require('./base')
class NoneKey extends Key {
constructor () {
super({ type: 'unsecured' }, { alg: 'none' })
Object.defineProperties(this, {
kid: { value: undefined },
kty: { value: undefined },
thumbprint: { value: undefined },
toJWK: { value: undefined },
toPEM: { value: undefined }
})
}
/* c8 ignore next 3 */
[inspect.custom] () {
return 'None {}'
}
algorithms (operation) {
switch (operation) {
case 'sign':
case 'verify':
case undefined:
return new Set(['none'])
default:
return new Set()
}
}
}
module.exports = new NoneKey()