Credential Verification

Validate Verifiable Credentials using Verification Service.

Supported Languages

Package: @affinidi-tdk/credential-verification-client

npm install @affinidi-tdk/credential-verification-client --save

Package: affinidi_tdk_credential_verification_client

pip install affinidi_tdk_credential_verification_client

Classes and Methods

Default API

Verify Verifiable Credentials and Verifiable Presentations.

verifyCredentials

Generate and issue a credentil offer to the user.

Parameters

VerifyCredentialInput [Object]

JSON object to provide the Verifiable Credentials to validate.

Module Imports
import { DefaultApi, Configuration, VerifyCredentialInput } from '@affinidi-tdk/credential-verification-client'
import affinidi_tdk_credential_verification_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
  apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})

const api = new DefaultApi(authConfiguration)

const request: VerifyCredentialInput = {
        "verifiableCredentials": [
            {
                ...
            }
        ],
        "issuerDidDocument": {
            "additionalProp1": "string"
        }
    }

const { data } = await api.verifyCredentials(request)
configuration = affinidi_tdk_credential_verification_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken

with affinidi_tdk_credential_verification_client.ApiClient(configuration) as api_client:
    api_instance = affinidi_tdk_credential_verification_client.DefaultApi(api_client)

    request_json = {
        "verifiableCredentials": [
            {
                ...
            }
        ],
        "issuerDidDocument": {
            "additionalProp1": "string"
        }
    }

    verify_credentials_input = affinidi_tdk_credential_verification_client.VerifyCredentialInput.from_dict(request_json)

    api_response = api_instance.verify_credentials(verify_credentials_input=verify_credentials_input)

verifyPresentation

Generate and issue a credentil offer to the user.

Parameters

VerifyPresentationInput [Object]

JSON object to provide the Verifiable Presentation to validate.

Module Imports
import { DefaultApi, Configuration, VerifyPresentationInput } from '@affinidi-tdk/credential-verification-client'
import affinidi_tdk_credential_verification_client
Sample Codes
// Pass the projectScopedToken generated from AuthProvider package
const authConfiguration = new Configuration({
  apiKey: authProvider.fetchProjectScopedToken.bind(authProvider)
})

const api = new DefaultApi(authConfiguration)

const request: VerifyPresentationInput = {
        "verifiablePresentation": {...},
        "signedPresentation": {...},
        "presentationDefinition": {...},
        "presentationSubmission": {...},
        "challenge": "string"
    }

const { data } = await api.verifyPresentation(projectId, request)
configuration = affinidi_tdk_credential_verification_client.Configuration()
# Pass the projectScopedToken generated from AuthProvider package
configuration.api_key['ProjectTokenAuth'] = projectScopedToken

with affinidi_tdk_credential_verification_client.ApiClient(configuration) as api_client:
    api_instance = affinidi_tdk_credential_verification_client.DefaultApi(api_client)

    request_json = {
            "verifiablePresentation": {...},
            "signedPresentation": {...},
            "presentationDefinition": {...},
            "presentationSubmission": {...},
            "challenge": "string"
        }

    verify_presentation_input = affinidi_tdk_credential_verification_client.VerifyPresentationInput.from_dict(request_json)

    api_response = api_instance.verify_presentation(projectId, verify_presentation_input=verify_presentation_input)