jose-node-esm-runtime
Advanced tools
Comparing version 4.1.4 to 4.1.5
@@ -65,3 +65,4 @@ import { decode as decodeBase64URL, encodeBase64, decodeBase64 } from '../runtime/base64url.js'; | ||
function spkiFromX509(buf) { | ||
return encodeBase64(getElement(getElement(parseElement(buf).contents)[0].contents)[6].raw); | ||
const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents); | ||
return encodeBase64(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw); | ||
} | ||
@@ -68,0 +69,0 @@ function getSPKI(x509) { |
@@ -37,4 +37,4 @@ import { createDecipheriv, KeyObject } from 'crypto'; | ||
try { | ||
const cipher = createDecipheriv(algorithm, encKey, iv); | ||
plaintext = concat(cipher.update(ciphertext), cipher.final()); | ||
const decipher = createDecipheriv(algorithm, encKey, iv); | ||
plaintext = concat(decipher.update(ciphertext), decipher.final()); | ||
} | ||
@@ -55,8 +55,10 @@ catch { | ||
try { | ||
const cipher = createDecipheriv(algorithm, cek, iv, { authTagLength: 16 }); | ||
cipher.setAuthTag(tag); | ||
const decipher = createDecipheriv(algorithm, cek, iv, { authTagLength: 16 }); | ||
decipher.setAuthTag(tag); | ||
if (aad.byteLength) { | ||
cipher.setAAD(aad, { plaintextLength: ciphertext.length }); | ||
decipher.setAAD(aad, { plaintextLength: ciphertext.length }); | ||
} | ||
return concat(cipher.update(ciphertext), cipher.final()); | ||
const plaintext = decipher.update(ciphertext); | ||
decipher.final(); | ||
return plaintext; | ||
} | ||
@@ -63,0 +65,0 @@ catch { |
@@ -39,3 +39,4 @@ import { createCipheriv, KeyObject } from 'crypto'; | ||
} | ||
const ciphertext = concat(cipher.update(plaintext), cipher.final()); | ||
const ciphertext = cipher.update(plaintext); | ||
cipher.final(); | ||
const tag = cipher.getAuthTag(); | ||
@@ -42,0 +43,0 @@ return { ciphertext, tag }; |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"description": "(Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167264
4231