Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
Signed-off-by: Mostafa Gamal <[email protected]>
  • Loading branch information
MosCD3 committed Nov 21, 2024
1 parent 498de1e commit 890b898
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/legacy/core/App/modules/openid/resolver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
DidKey,
JwaSignatureAlgorithm,
JwkDidCreateOptions,
KeyBackend,
KeyDidCreateOptions,
KeyType,
SdJwtVcRecord,
Expand All @@ -12,7 +13,11 @@ import {
W3cCredentialRepository,
getJwkFromKey,
} from '@credo-ts/core'
import { OpenId4VciCredentialFormatProfile, OpenId4VciCredentialSupportedWithId, OpenId4VciSupportedCredentialFormats } from '@credo-ts/openid4vc'
import {
OpenId4VciCredentialFormatProfile,
OpenId4VciCredentialSupportedWithId,
OpenId4VciSupportedCredentialFormats,
} from '@credo-ts/openid4vc'
import { extractOpenId4VcCredentialMetadata, setOpenId4VcCredentialMetadata } from './metadata'

export type OpenID4VCIParam = {
Expand Down Expand Up @@ -103,6 +108,7 @@ export const receiveCredentialFromOpenId4VciOffer = async ({ agent, data, uri }:
if (supportsJwk && credentialFormat === OpenId4VciCredentialFormatProfile.SdJwtVc) {
const key = await agent.wallet.createKey({
keyType,
keyBackend: KeyBackend.SecureElement,
})
return {
method: 'jwk',
Expand Down Expand Up @@ -156,7 +162,6 @@ export const receiveCredentialFromOpenId4VciOffer = async ({ agent, data, uri }:
return record
}


export async function storeCredential(agent: Agent, credentialRecord: W3cCredentialRecord | SdJwtVcRecord) {
if (credentialRecord instanceof W3cCredentialRecord) {
await agent.dependencyManager.resolve(W3cCredentialRepository).save(agent.context, credentialRecord)
Expand Down

0 comments on commit 890b898

Please sign in to comment.