mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
add a few sigalg names for caution
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
export function toStandardName(jmrtdName: string): string {
|
||||
switch (jmrtdName) {
|
||||
|
||||
// hash functions
|
||||
case "SHA-1":
|
||||
case "SHA1":
|
||||
@@ -22,6 +23,7 @@ export function toStandardName(jmrtdName: string): string {
|
||||
case "SHA-512":
|
||||
case "SHA512":
|
||||
return "sha512";
|
||||
|
||||
// sig algs
|
||||
case "SHA1withECDSA":
|
||||
return "ecdsa-with-SHA1";
|
||||
@@ -53,8 +55,16 @@ export function toStandardName(jmrtdName: string): string {
|
||||
return "rsassa-pss";
|
||||
case "SHA256withRSAandMGF1":
|
||||
return "id-mgf1"
|
||||
|
||||
// added this one for iOS
|
||||
case "rsaEncryption":
|
||||
return "sha256WithRSAEncryption"; // added this one for iOS
|
||||
// for security
|
||||
case "SHA256WITHRSA":
|
||||
case "SHA256withRSA":
|
||||
case "sha256withRSA":
|
||||
case "sha256withrsa":
|
||||
case "SHA256WITHRSAENCRYPTION":
|
||||
return "sha256WithRSAEncryption";
|
||||
default:
|
||||
console.log(`JMRTD sig alg or hash function ${jmrtdName} not found in mapping, returning it as it is`);
|
||||
return jmrtdName;
|
||||
|
||||
Reference in New Issue
Block a user