-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sd-jwt-support
Signed-off-by: F-Node-Karlsruhe <christian.fries@eecc.de>
- Loading branch information
Showing
11 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ module.exports = { | |
}, | ||
], | ||
}, | ||
testTimeout: 60000 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
|
||
import { verifyDataIntegrityProof } from './dataintegrity.js'; | ||
import { verifySDJWT } from './sdjwt.js'; | ||
|
||
|
||
|
||
|
||
export class Verifier { | ||
|
||
static async verify(verifiable: Verifiable | string, challenge?: string, domain?: string): Promise<VerificationResult> { | ||
|
||
// vc-jwt or sd-jwt | ||
if (typeof verifiable == 'string') return await verifySDJWT(verifiable, challenge, domain) | ||
if (typeof verifiable == 'string' && verifiable.startsWith('ey')) return await verifySDJWT(verifiable, challenge, domain) | ||
|
||
// DataIntegrityProof | ||
return await verifyDataIntegrityProof(verifiable, challenge, domain); | ||
|
||
if (typeof verifiable == 'object') return await verifyDataIntegrityProof(verifiable, challenge, domain); | ||
|
||
throw new Error('Unrecognized credential type!') | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters