/var/www/p4ela.kz/server/delivery/node_modules/jose/lib/jwa
NameSizeModeActions
ecdh/-0755rm
aes_cbc_hmac_sha2.js25200644editdlrm
aes_gcm.js18140644editdlrm
aes_gcm_kw.js9250644editdlrm
aes_kw.js13450644editdlrm
ecdsa.js23470644editdlrm
eddsa.js8420644editdlrm
hmac.js9980644editdlrm
index.js23860644editdlrm
none.js1950644editdlrm
pbes2.js21060644editdlrm
rsaes.js19900644editdlrm
rsassa.js10250644editdlrm
rsassa_pss.js12930644editdlrm
Edit: /var/www/p4ela.kz/server/delivery/node_modules/jose/lib/jwa/aes_kw.js (1345B)
const { createCipheriv, createDecipheriv, getCiphers } = require('crypto') const { KEYOBJECT } = require('../help/consts') const { asInput } = require('../help/key_object') const checkInput = (data) => { if (data !== undefined && data.length % 8 !== 0) { throw new Error('invalid data length') } } const wrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) const cipher = createCipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return { wrapped: Buffer.concat([cipher.update(payload), cipher.final()]) } } const unwrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) checkInput(payload) const cipher = createDecipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return Buffer.concat([cipher.update(payload), cipher.final()]) } module.exports = (JWA, JWK) => { ['A128KW', 'A192KW', 'A256KW'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) const alg = `aes${size}-wrap` if (getCiphers().includes(alg)) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, alg)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, alg)) JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) }