Giter Site home page Giter Site logo

Get Issued Credentials about ssi-sdk HOT 4 CLOSED

DevId1000 avatar DevId1000 commented on May 23, 2024
Get Issued Credentials

from ssi-sdk.

Comments (4)

sanderPostma avatar sanderPostma commented on May 23, 2024

Are you referring to all the types of credentials it can issue, or all the credentials itself that have been issued? If it's the former, you can utilize the following endpoint configuration for that particular endpoint:

https://<agent host>/.well-known/openid-credential-issuer

Look under "credentials_supported" then types. An example can be found here.

If it's the latter, I'll need to check this for you. We have a vc-status-list module, but I'll need to verify which credentials are stored there and what their life cycle is.

from ssi-sdk.

DevId1000 avatar DevId1000 commented on May 23, 2024

Yes, yes, i'm aware of this https://<agent host>/.well-known/openid-credential-issuer , but i'm asking about the second one 'all the credentials itself that have been issued'.
Actually the question is, when the credential is issued it's stored on the wallet side, but is it stored somewhere on the agent side, or not?

from ssi-sdk.

nklomp avatar nklomp commented on May 23, 2024

Hi @DevId1000 By default the agent doesn't store issued credentials. We have the default Veramo datastore and datastoreOrm available though. There is also an optional parameter that can save the credential in the datastore during issuance. We probably aren't currently exposing that in the OID4VCI flows though.

 const verifiableCredential = await agent.createVerifiableCredential({
        credential: {
          issuer: { id: identifiers[0].did },
          issuanceDate: new Date().toISOString(),
          credentialSubject: {
            id: 'did:web:community.veramo.io',
            you: 'Rock',
          },
        },
        save: true,
        proofFormat: 'jwt',
      })

Then, provided that you have configured the agent with a dataStore and dataStoreORM, you would be able to query the credential by hash/id, or query for multiple credentials even by claims in the credentials

See for instance the following methods
https://veramo.io/docs/api/data-store.datastoreorm.datastoreormgetverifiablecredentials
https://veramo.io/docs/api/data-store.datastoreorm.datastoreormgetverifiablecredentialsbyclaims

So something like this is entirely possible:

 const idOrHash = 'my VC id or calculated hash here';
 const uniqueVCs = await agent.dataStoreORMGetVerifiableCredentials({
      where: [
        {
          column: 'id',
          value: [idOrHash],
          op: 'Equal',
        },
      ],
    })

from ssi-sdk.

DevId1000 avatar DevId1000 commented on May 23, 2024

Hi @DevId1000 By default the agent doesn't store issued credentials. We have the default Veramo datastore and datastoreOrm available though. There is also an optional parameter that can save the credential in the datastore during issuance. We probably aren't currently exposing that in the OID4VCI flows though.

 const verifiableCredential = await agent.createVerifiableCredential({
        credential: {
          issuer: { id: identifiers[0].did },
          issuanceDate: new Date().toISOString(),
          credentialSubject: {
            id: 'did:web:community.veramo.io',
            you: 'Rock',
          },
        },
        save: true,
        proofFormat: 'jwt',
      })

Then, provided that you have configured the agent with a dataStore and dataStoreORM, you would be able to query the credential by hash/id, or query for multiple credentials even by claims in the credentials

See for instance the following methods https://veramo.io/docs/api/data-store.datastoreorm.datastoreormgetverifiablecredentials https://veramo.io/docs/api/data-store.datastoreorm.datastoreormgetverifiablecredentialsbyclaims

So something like this is entirely possible:

 const idOrHash = 'my VC id or calculated hash here';
 const uniqueVCs = await agent.dataStoreORMGetVerifiableCredentials({
      where: [
        {
          column: 'id',
          value: [idOrHash],
          op: 'Equal',
        },
      ],
    })

Thanks!

from ssi-sdk.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.