Skip to main content

core-types package

Provides Agent implementation and defines IResolver, IDIDManager, IKeyManager, IDataStore, IMessageHandler plugin interfaces

Interfaces

InterfaceDescription
AuthorizedDIDContext

(BETA) This context can be used for Veramo Agents that are created behind an authorization mechanism, that attaches a DID as the authorized executor of certain actions. This authorized DID is used to further filter the data that is available for querying.

This does not constitute an authorization mechanism, but relies on an authorization mechanism existing before the Veramo Agent is created.

This API may change without a BREAKING CHANGE notice.

CredentialPayload

(BETA) Used as input when creating Verifiable Credentials

This API may change without prior notice.

CredentialStatusGenerateArgs(BETA) Arguments for generating a credentialStatus property for a VerifiableCredential.
CredentialStatusUpdateArgs(BETA) Input arguments for credentialStatusUpdate
FindArgs

(BETA) Represents an IDataStoreORM Query.

This API may change without a BREAKING CHANGE notice.

GetDIDComponentArgs(BETA) Input arguments for getDIDComponentById This API may change without a BREAKING CHANGE notice.
IAgentAgent that can execute methods
IAgentBaseAgent base interface
IAgentContextStandard plugin method context interface
IAgentOptions

Agent configuration options.

This interface is used to describe the constellation of plugins that this agent will use and provide.

You will use this to attach plugins, to setup overrides for their methods and to explicitly set the methods that this agent instance is allowed to call. This permissioning method is also used for internal calls made by plugin code.

IAgentPluginAgent plugin interface
IAgentPluginSchemaAgent plugin schema
ICheckCredentialStatusArgs

(BETA) Arguments for calling checkCredentialStatus.

The credential whose status should be checked and the DID document of the credential issuer.

See Credential Status

This API may change without a BREAKING CHANGE notice.

ICreateVerifiableCredentialArgsEncapsulates the parameters required to create a W3C Verifiable Credential
ICreateVerifiablePresentationArgsEncapsulates the parameters required to create a W3C Verifiable Presentation
ICredentialIssuerThe interface definition for a plugin that can generate Verifiable Credentials and Presentations
ICredentialStatusManager(BETA) Credential status manager interface
ICredentialStatusVerifier

(BETA) This interface defines a plugin that can check the status of a Verifiable Credential.

This is used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific credentialStatus type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.

The result provided by implementations of this plugin depend on whether the implementation of the StatusMethod is available.

ICredentialVerifierThe interface definition for a plugin that can generate Verifiable Credentials and Presentations
IDataStoreBasic data store interface
IDataStoreDeleteMessageArgsInput arguments for dataStoreDeleteMessage
IDataStoreDeleteVerifiableCredentialArgsInput arguments for IDataStoreDeleteVerifiableCredentialArgs
IDataStoreGetMessageArgsInput arguments for dataStoreGetMessage
IDataStoreGetVerifiableCredentialArgsInput arguments for dataStoreGetVerifiableCredential
IDataStoreGetVerifiablePresentationArgsInput arguments for dataStoreGetVerifiablePresentation
IDataStoreORM

(BETA) This is the default query interface for the credential data stored by a Veramo agent.

Plugins implementing this interface are expected to implement this simple query functionality to filter the data that was saved using IDataStore.

If this interface is implemented by a different plugin than IDataStore, then both plugins MUST use the same media for data storage.

IDataStoreSaveMessageArgsInput arguments for dataStoreSaveMessage
IDataStoreSaveVerifiableCredentialArgsInput arguments for dataStoreSaveVerifiableCredential
IDataStoreSaveVerifiablePresentationArgsInput arguments for dataStoreSaveVerifiablePresentation
IDIDManagerIdentifier manager interface
IDIDManagerAddKeyArgsInput arguments for didManagerAddKey
IDIDManagerAddServiceArgsInput arguments for didManagerAddService
IDIDManagerCreateArgsInput arguments for didManagerCreate
IDIDManagerDeleteArgsInput arguments for didManagerDelete
IDIDManagerFindArgsInput arguments for didManagerFind
IDIDManagerGetArgsInput arguments for didManagerGet
IDIDManagerGetByAliasArgsInput arguments for didManagerGetByAlias
IDIDManagerGetOrCreateArgsInput arguments for didManagerGetOrCreate
IDIDManagerRemoveKeyArgsInput arguments for didManagerRemoveKey
IDIDManagerRemoveServiceArgsInput arguments for didManagerRemoveService
IDIDManagerSetAliasArgsInput arguments for didManagerSetAlias
IDIDManagerUpdateArgs(BETA) The arguments necessary to perform a full DID document update for a DID.
IError(BETA) An error object, which can contain a code.
IEventListenerDescribes a listener interface that needs to be implemented by components interested in listening to events emitted by an agent.
IHandleMessageArgsInput arguments for handleMessage
IIdentifierIdentifier interface
IKeyCryptographic key, usually managed by the current Veramo instance.
IKeyManager

Key manager interface.

This defines an interface for a plugin that orchestrates various implementations of AbstractKeyManagementSystem.

See KeyManager for a reference implementation.

The methods of this plugin are used automatically by other plugins, such as DIDManager, CredentialPlugin, or DIDComm to perform their required cryptographic operations using the managed keys.

IKeyManagerCreateArgsInput arguments for keyManagerCreate
IKeyManagerDecryptJWEArgs(BETA) Input arguments for keyManagerDecryptJWE This API may change without a BREAKING CHANGE notice.
IKeyManagerDeleteArgsInput arguments for keyManagerDelete
IKeyManagerEncryptJWEArgs(BETA) Input arguments for keyManagerEncryptJWE This API may change without a BREAKING CHANGE notice.
IKeyManagerGetArgsInput arguments for keyManagerGet
IKeyManagerSharedSecretArgsInput arguments for keyManagerSharedSecret
IKeyManagerSignArgsInput arguments for keyManagerSign
IKeyManagerSignEthTXArgsInput arguments for keyManagerSignEthTX
IKeyManagerSignJWTArgsInput arguments for keyManagerSignJWT
IMessageRepresents a DIDComm v1 message payload, with optionally decoded credentials and presentations.
IMessageAttachmentMessage attachment
IMessageAttachmentData

(BETA) The DIDComm message structure for data in an attachment. See https://identity.foundation/didcomm-messaging/spec/\#attachments

This API may change without a BREAKING CHANGE notice.

IMessageHandlerMessage handler plugin interface.
IMetaDataMessage meta data
IPluginMethodAgent plugin method interface
IPluginMethodMapPlugin method map interface
IResolverDID Resolver interface
IServiceIdentifier service
IVerifyCredentialArgsEncapsulates the parameters required to verify a W3C Verifiable Credential
IVerifyPresentationArgsEncapsulates the parameters required to verify a W3C Verifiable Presentation
IVerifyResult(BETA) Encapsulates the response object to verifyPresentation method after verifying a W3C Verifiable Presentation
KeyMetadata

This encapsulates data about a key.

Implementations of AbstractKeyManagementSystem should populate this object, for each key, with the algorithms that can be performed using it.

This can also be used to add various tags to the keys under management.

Order

(BETA) Represents the sort order of results from a FindArgs query.

This API may change without a BREAKING CHANGE notice.

PresentationPayload

(BETA) Used as input when creating Verifiable Presentations

This API may change without prior notice.

ProofType

(BETA) A proof property of a VerifiableCredential or VerifiablePresentation

This API may change without a BREAKING CHANGE notice.

RemoveContextRemoves context parameter from plugin method interface
ResolveDidArgsInput arguments for resolveDid
UniqueVerifiableCredential

(BETA) Represents the result of a Query for VerifiableCredentials

See IDataStoreORM.dataStoreORMGetVerifiableCredentials() See IDataStoreORM.dataStoreORMGetVerifiableCredentialsByClaims()

This API may change without a BREAKING CHANGE notice.

UniqueVerifiablePresentation

(BETA) Represents the result of a Query for VerifiablePresentations

See IDataStoreORM.dataStoreORMGetVerifiablePresentations()

This API may change without a BREAKING CHANGE notice.

UnsignedCredential

(BETA) Represents an unsigned W3C Credential payload. See VC data model

This API may change without a BREAKING CHANGE notice.

UnsignedPresentationRepresents an unsigned W3C Presentation payload. See VP data model
UsingResolutionOptionsOptions that are forwarded to the DID resolver.
VerificationPolicies(BETA) These optional settings can be used to override some default checks that are performed on Presentations during verification.
Where

(BETA) Represents a WHERE predicate for a FindArgs query. In situations where multiple WHERE predicates are present, they are combined with AND.

This API may change without a BREAKING CHANGE notice.

Variables

VariableDescription
CoreEventsThis collection defines the core event types.
KEY_ALG_MAPPINGMapping of known key types(TKeyType) to the known algorithms(TAlg) they should support.
schema

Type Aliases

Type AliasDescription
CompactJWT

(BETA) Represents a Json Web Token in compact form. "header.payload.signature"

This API may change without a BREAKING CHANGE notice.

ContextType

(BETA) The data type for @context properties of credentials, presentations, etc.

This API may change without a BREAKING CHANGE notice.

CredentialStatus

(BETA) Represents the result of a status check.

Implementations MUST populate the revoked boolean property, but they can return additional metadata that is method specific.

CredentialStatusReference

(BETA) Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific credentialStatus type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.

See Credential Status

This API may change without a BREAKING CHANGE notice.

CredentialSubject

(BETA) The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.

See Credential Subject

This API may change without a BREAKING CHANGE notice.

DateType

(BETA) Represents an issuance or expiration date for Credentials / Presentations. This is used as input when creating them.

This API may change without prior notice.

DIDDocComponent(BETA) Return type of getDIDComponentById represents a VerificationMethod or a ServiceEndpoint entry from a This API may change without a BREAKING CHANGE notice.
DIDDocumentSection

Refers to a section of a DID document. Either the list of verification methods or services or one of the verification relationships.

See verification relationships

FindClaimsArgs

(BETA) The filter that can be used to find VerifiableCredentials in the data store, based on the types and values of their claims.

See IDataStoreORM.dataStoreORMGetVerifiableCredentialsByClaims() This API may change without a BREAKING CHANGE notice.

FindCredentialsArgs

(BETA) The filter that can be used to find VerifiableCredentials in the data store. See IDataStoreORM.dataStoreORMGetVerifiableCredentials()

This API may change without a BREAKING CHANGE notice.

FindIdentifiersArgs

(BETA) The filter that can be used to find IIdentifiers in the data store.

This API may change without a BREAKING CHANGE notice.

FindMessagesArgs

(BETA) The filter that can be used to find IMessages in the data store. See IDataStoreORM.dataStoreORMGetMessages()

This API may change without a BREAKING CHANGE notice.

FindPresentationsArgs

(BETA) The filter that can be used to find VerifiablePresentations in the data store. See IDataStoreORM.dataStoreORMGetVerifiablePresentations()

This API may change without a BREAKING CHANGE notice.

ICredentialPluginThe interface definition for a plugin that can generate and verify Verifiable Credentials and Presentations
ICredentialStatus(BETA) Veramo plugin interface for plugins implementing both the manager and the verifier aspects of Credential Status flow.
IServiceEndpointRepresents a service endpoint URL or a map of URLs
IssuerAgentContext

(BETA) Represents the requirements that this plugin has. The agent that is using this plugin is expected to provide these methods.

This interface can be used for static type checks, to make sure your application is properly initialized.

IssuerType

(BETA) The issuer of a VerifiableCredential or the holder of a VerifiablePresentation.

The value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.

See Issuer data model

This API may change without a BREAKING CHANGE notice.

ManagedKeyInfoRepresents information about a managed key. Private or secret key material is NOT present.
MinimalImportableIdentifierRepresents the minimum amount of information needed to import an IIdentifier.
MinimalImportableKeyRepresents the properties required to import a key.
PartialIdentifier

(BETA) The result of a IDataStoreORM.dataStoreORMGetIdentifiers() query.

This API may change without a BREAKING CHANGE notice.

ProofFormat

The type of encoding to be used for the Verifiable Credential or Presentation to be generated.

Only jwt and lds is supported at the moment.

RequireOnlyRepresents an object type where a subset of keys are required and everything else is optional.
TAgentUtility type for constructing agent type that has a list of available methods
TAlg

Known algorithms supported by some of the above key types defined by TKeyType.

Actual implementations of Key Management Systems can support more. One should check the IKey.meta.algorithms property to see what is possible for a particular managed key.

TClaimsColumns

(BETA) The columns that can be searched for the claims of a VerifiableCredential

See IDataStoreORM.dataStoreORMGetVerifiableCredentialsByClaims() See IDataStoreORM.dataStoreORMGetVerifiableCredentialsByClaimsCount()

This API may change without a BREAKING CHANGE notice.

TCredentialColumns

(BETA) The columns that can be searched for a VerifiableCredential

See IDataStoreORM.dataStoreORMGetVerifiableCredentials() See IDataStoreORM.dataStoreORMGetVerifiableCredentialsCount()

This API may change without a BREAKING CHANGE notice.

TIdentifiersColumns(BETA) The columns that can be queried for an IIdentifier
TKeyTypeCryptographic key type.
TMessageColumns

(BETA) The columns that can be queried for an IMessage

See IDataStoreORM.dataStoreORMGetMessagesCount() This API may change without a BREAKING CHANGE notice.

TPresentationColumns

(BETA) The columns that can be searched for a VerifiablePresentation

See IDataStoreORM.dataStoreORMGetVerifiablePresentations() See IDataStoreORM.dataStoreORMGetVerifiablePresentationsCount()

This API may change without a BREAKING CHANGE notice.

VerifiableCredential

(BETA) Represents a signed Verifiable Credential payload (includes proof), using a JSON representation. See VC data model

This API may change without a BREAKING CHANGE notice.

VerifiablePresentationRepresents a signed Verifiable Presentation (includes proof), using a JSON representation. See VP data model
VerifierAgentContext

(BETA) Represents the requirements that this plugin has. The agent that is using this plugin is expected to provide these methods.

This interface can be used for static type checks, to make sure your application is properly initialized.

W3CVerifiableCredential

(BETA) Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format. See VC data model See proof formats

This API may change without a BREAKING CHANGE notice.

W3CVerifiablePresentationRepresents a signed Verifiable Presentation (includes proof) in either JSON or compact JWT format. See VC data model