INNER CODE UNIT · JavaScript

algPermutations

DinoChiesa/jwt-webtool · src/js/app.js:84

function algPermutations(prefixes) {
  return prefixes.reduce(
    (a, v) => [...a, ...[256, 384, 512].map((x) => v + x)],
    [],
  );
}

const rsaSigningAlgs = algPermutations(["RS", "PS"]),
  ecdsaSigningAlgs = algPermutations(["ES"]),
  hmacSigningAlgs = algPermutations(["HS"]),
  signingAlgs = [...rsaSigningAlgs, ...ecdsaSigningAlgs, ...hmacSigningAlgs],
  rsaKeyEncryptionAlgs = ["RSA-OAEP", "RSA-OAEP-256"],
  ecdhKeyEncryptionAlgs = ["ECDH-ES", "ECDH-ES+A128KW", "ECDH-ES+A256KW"], // 'ECDH-ES+A192KW' not supported
  pbes2KeyEncryptionAlgs = [
    "PBES2-HS256+A128KW",
    "PBES2-HS384+A192KW",
    "PBES2-HS512+A256KW",
  ],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…