@sphereon/ssi-sdk-ext.key-utils 0.36.1-feature.SSISDK.82.and.SSISDK.70.35 → 0.36.1-feature.integration.fides.68
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.cjs +95 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/conversion.ts +53 -0
package/dist/index.cjs
CHANGED
|
@@ -59,6 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
isSameHash: () => isSameHash,
|
|
60
60
|
jcsCanonicalize: () => jcsCanonicalize,
|
|
61
61
|
joseAlgorithmToDigest: () => joseAlgorithmToDigest,
|
|
62
|
+
joseSignatureAlgToWebCrypto: () => joseSignatureAlgToWebCrypto,
|
|
62
63
|
joseToCoseCurve: () => joseToCoseCurve,
|
|
63
64
|
joseToCoseKeyOperation: () => joseToCoseKeyOperation,
|
|
64
65
|
joseToCoseKty: () => joseToCoseKty,
|
|
@@ -1540,4 +1541,98 @@ function coseToJoseCurve(curve) {
|
|
|
1540
1541
|
}
|
|
1541
1542
|
}
|
|
1542
1543
|
__name(coseToJoseCurve, "coseToJoseCurve");
|
|
1544
|
+
function joseSignatureAlgToWebCrypto(alg) {
|
|
1545
|
+
switch (alg) {
|
|
1546
|
+
case import_ssi_types2.JoseSignatureAlgorithm.RS256:
|
|
1547
|
+
case "RS256":
|
|
1548
|
+
return {
|
|
1549
|
+
name: "RSASSA-PKCS1-v1_5",
|
|
1550
|
+
hash: "SHA-256"
|
|
1551
|
+
};
|
|
1552
|
+
case import_ssi_types2.JoseSignatureAlgorithm.RS384:
|
|
1553
|
+
case "RS384":
|
|
1554
|
+
return {
|
|
1555
|
+
name: "RSASSA-PKCS1-v1_5",
|
|
1556
|
+
hash: "SHA-384"
|
|
1557
|
+
};
|
|
1558
|
+
case import_ssi_types2.JoseSignatureAlgorithm.RS512:
|
|
1559
|
+
case "RS512":
|
|
1560
|
+
return {
|
|
1561
|
+
name: "RSASSA-PKCS1-v1_5",
|
|
1562
|
+
hash: "SHA-512"
|
|
1563
|
+
};
|
|
1564
|
+
case import_ssi_types2.JoseSignatureAlgorithm.PS256:
|
|
1565
|
+
case "PS256":
|
|
1566
|
+
return {
|
|
1567
|
+
name: "RSA-PSS",
|
|
1568
|
+
hash: "SHA-256",
|
|
1569
|
+
saltLength: 32
|
|
1570
|
+
};
|
|
1571
|
+
case import_ssi_types2.JoseSignatureAlgorithm.PS384:
|
|
1572
|
+
case "PS384":
|
|
1573
|
+
return {
|
|
1574
|
+
name: "RSA-PSS",
|
|
1575
|
+
hash: "SHA-384",
|
|
1576
|
+
saltLength: 48
|
|
1577
|
+
};
|
|
1578
|
+
case import_ssi_types2.JoseSignatureAlgorithm.PS512:
|
|
1579
|
+
case "PS512":
|
|
1580
|
+
return {
|
|
1581
|
+
name: "RSA-PSS",
|
|
1582
|
+
hash: "SHA-512",
|
|
1583
|
+
saltLength: 64
|
|
1584
|
+
};
|
|
1585
|
+
case import_ssi_types2.JoseSignatureAlgorithm.ES256:
|
|
1586
|
+
case "ES256":
|
|
1587
|
+
return {
|
|
1588
|
+
name: "ECDSA",
|
|
1589
|
+
hash: "SHA-256"
|
|
1590
|
+
};
|
|
1591
|
+
case import_ssi_types2.JoseSignatureAlgorithm.ES384:
|
|
1592
|
+
case "ES384":
|
|
1593
|
+
return {
|
|
1594
|
+
name: "ECDSA",
|
|
1595
|
+
hash: "SHA-384"
|
|
1596
|
+
};
|
|
1597
|
+
case import_ssi_types2.JoseSignatureAlgorithm.ES512:
|
|
1598
|
+
case "ES512":
|
|
1599
|
+
return {
|
|
1600
|
+
name: "ECDSA",
|
|
1601
|
+
hash: "SHA-512"
|
|
1602
|
+
};
|
|
1603
|
+
case import_ssi_types2.JoseSignatureAlgorithm.ES256K:
|
|
1604
|
+
case "ES256K":
|
|
1605
|
+
return {
|
|
1606
|
+
name: "ECDSA",
|
|
1607
|
+
hash: "SHA-256"
|
|
1608
|
+
};
|
|
1609
|
+
case import_ssi_types2.JoseSignatureAlgorithm.EdDSA:
|
|
1610
|
+
case "EdDSA":
|
|
1611
|
+
return {
|
|
1612
|
+
name: "Ed25519",
|
|
1613
|
+
hash: ""
|
|
1614
|
+
};
|
|
1615
|
+
case import_ssi_types2.JoseSignatureAlgorithm.HS256:
|
|
1616
|
+
case "HS256":
|
|
1617
|
+
return {
|
|
1618
|
+
name: "HMAC",
|
|
1619
|
+
hash: "SHA-256"
|
|
1620
|
+
};
|
|
1621
|
+
case import_ssi_types2.JoseSignatureAlgorithm.HS384:
|
|
1622
|
+
case "HS384":
|
|
1623
|
+
return {
|
|
1624
|
+
name: "HMAC",
|
|
1625
|
+
hash: "SHA-384"
|
|
1626
|
+
};
|
|
1627
|
+
case import_ssi_types2.JoseSignatureAlgorithm.HS512:
|
|
1628
|
+
case "HS512":
|
|
1629
|
+
return {
|
|
1630
|
+
name: "HMAC",
|
|
1631
|
+
hash: "SHA-512"
|
|
1632
|
+
};
|
|
1633
|
+
default:
|
|
1634
|
+
throw Error(`Signature algorithm ${alg} not supported in Web Crypto API`);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
__name(joseSignatureAlgToWebCrypto, "joseSignatureAlgToWebCrypto");
|
|
1543
1638
|
//# sourceMappingURL=index.cjs.map
|