@sphereon/ssi-sdk-ext.key-utils 0.36.1-feature.SSISDK.82.and.SSISDK.70.37 → 0.36.1-feature.integration.fides.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1450,6 +1450,100 @@ function coseToJoseCurve(curve) {
1450
1450
  }
1451
1451
  }
1452
1452
  __name(coseToJoseCurve, "coseToJoseCurve");
1453
+ function joseSignatureAlgToWebCrypto(alg) {
1454
+ switch (alg) {
1455
+ case JoseSignatureAlgorithm2.RS256:
1456
+ case "RS256":
1457
+ return {
1458
+ name: "RSASSA-PKCS1-v1_5",
1459
+ hash: "SHA-256"
1460
+ };
1461
+ case JoseSignatureAlgorithm2.RS384:
1462
+ case "RS384":
1463
+ return {
1464
+ name: "RSASSA-PKCS1-v1_5",
1465
+ hash: "SHA-384"
1466
+ };
1467
+ case JoseSignatureAlgorithm2.RS512:
1468
+ case "RS512":
1469
+ return {
1470
+ name: "RSASSA-PKCS1-v1_5",
1471
+ hash: "SHA-512"
1472
+ };
1473
+ case JoseSignatureAlgorithm2.PS256:
1474
+ case "PS256":
1475
+ return {
1476
+ name: "RSA-PSS",
1477
+ hash: "SHA-256",
1478
+ saltLength: 32
1479
+ };
1480
+ case JoseSignatureAlgorithm2.PS384:
1481
+ case "PS384":
1482
+ return {
1483
+ name: "RSA-PSS",
1484
+ hash: "SHA-384",
1485
+ saltLength: 48
1486
+ };
1487
+ case JoseSignatureAlgorithm2.PS512:
1488
+ case "PS512":
1489
+ return {
1490
+ name: "RSA-PSS",
1491
+ hash: "SHA-512",
1492
+ saltLength: 64
1493
+ };
1494
+ case JoseSignatureAlgorithm2.ES256:
1495
+ case "ES256":
1496
+ return {
1497
+ name: "ECDSA",
1498
+ hash: "SHA-256"
1499
+ };
1500
+ case JoseSignatureAlgorithm2.ES384:
1501
+ case "ES384":
1502
+ return {
1503
+ name: "ECDSA",
1504
+ hash: "SHA-384"
1505
+ };
1506
+ case JoseSignatureAlgorithm2.ES512:
1507
+ case "ES512":
1508
+ return {
1509
+ name: "ECDSA",
1510
+ hash: "SHA-512"
1511
+ };
1512
+ case JoseSignatureAlgorithm2.ES256K:
1513
+ case "ES256K":
1514
+ return {
1515
+ name: "ECDSA",
1516
+ hash: "SHA-256"
1517
+ };
1518
+ case JoseSignatureAlgorithm2.EdDSA:
1519
+ case "EdDSA":
1520
+ return {
1521
+ name: "Ed25519",
1522
+ hash: ""
1523
+ };
1524
+ case JoseSignatureAlgorithm2.HS256:
1525
+ case "HS256":
1526
+ return {
1527
+ name: "HMAC",
1528
+ hash: "SHA-256"
1529
+ };
1530
+ case JoseSignatureAlgorithm2.HS384:
1531
+ case "HS384":
1532
+ return {
1533
+ name: "HMAC",
1534
+ hash: "SHA-384"
1535
+ };
1536
+ case JoseSignatureAlgorithm2.HS512:
1537
+ case "HS512":
1538
+ return {
1539
+ name: "HMAC",
1540
+ hash: "SHA-512"
1541
+ };
1542
+ default:
1543
+ throw Error(`Signature algorithm ${alg} not supported in Web Crypto API`);
1544
+ }
1545
+ }
1546
+ __name(joseSignatureAlgToWebCrypto, "joseSignatureAlgToWebCrypto");
1453
1547
  export {
1454
1548
  ENC_KEY_ALGS,
1455
1549
  JWK_JCS_PUB_NAME,
@@ -1479,6 +1573,7 @@ export {
1479
1573
  isSameHash,
1480
1574
  jcsCanonicalize,
1481
1575
  joseAlgorithmToDigest,
1576
+ joseSignatureAlgToWebCrypto,
1482
1577
  joseToCoseCurve,
1483
1578
  joseToCoseKeyOperation,
1484
1579
  joseToCoseKty,