import { CredentialPayload, IAgentContext, IDIDManager, IKeyManager, IPluginMethodMap, IResolver, PresentationPayload, VerifiableCredential, VerifiablePresentation } from '@verixyz/core'; /** * The interface definition for a plugin that can issue and verify Verifiable Credentials and Presentations * that use JSON-LD format. * * @remarks Please see {@link https://www.w3.org/TR/vc-data-model | W3C Verifiable Credentials data model} * * @beta This API is likely to change without a BREAKING CHANGE notice */ export interface ICredentialIssuerLD extends IPluginMethodMap { /** * Creates a Verifiable Presentation. * The payload, signer and format are chosen based on the `args` parameter. * * @param args - Arguments necessary to create the Presentation. * @param context - This reserved param is automatically added and handled by the framework, *do not override* * * @returns - a promise that resolves to the {@link @verixyz/core#VerifiablePresentation} that was requested or rejects with an error * if there was a problem with the input or while getting the key to sign * * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#presentations | Verifiable Presentation data model } * * @beta This API is likely to change without a BREAKING CHANGE notice */ createVerifiablePresentationLD(args: ICreateVerifiablePresentationLDArgs, context: IRequiredContext): Promise; /** * Creates a Verifiable Credential. * The payload, signer and format are chosen based on the `args` parameter. * * @param args - Arguments necessary to create the Presentation. * @param context - This reserved param is automatically added and handled by the framework, *do not override* * * @returns - a promise that resolves to the {@link @verixyz/core#VerifiableCredential} that was requested or rejects with an error * if there was a problem with the input or while getting the key to sign * * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#credentials | Verifiable Credential data model} * * @beta This API is likely to change without a BREAKING CHANGE notice */ createVerifiableCredentialLD(args: ICreateVerifiableCredentialLDArgs, context: IRequiredContext): Promise; /** * Verifies a Verifiable Credential JWT or LDS Format. * * @param args - Arguments necessary to verify a VerifiableCredential * @param context - This reserved param is automatically added and handled by the framework, *do not override* * * @returns - a promise that resolves to the boolean true on successful verification or rejects on error * * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#credentials | Verifiable Credential data model} * * @beta This API is likely to change without a BREAKING CHANGE notice */ verifyCredentialLD(args: IVerifyCredentialLDArgs, context: IRequiredContext): Promise; /** * Verifies a Verifiable Presentation JWT or LDS Format. * * @param args - Arguments necessary to verify a VerifiableCredential * @param context - This reserved param is automatically added and handled by the framework, *do not override* * * @returns - a promise that resolves to the boolean true on successful verification or rejects on error * * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#presentations | Verifiable Credential data model} * * @beta This API is likely to change without a BREAKING CHANGE notice */ verifyPresentationLD(args: IVerifyPresentationLDArgs, context: IRequiredContext): Promise; } /** * Encapsulates the parameters required to create a * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation} * * @beta This API is likely to change without a BREAKING CHANGE notice */ export interface ICreateVerifiablePresentationLDArgs { /** * The json payload of the Presentation according to the * {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model}. * * The signer of the Presentation is chosen based on the `holder` property * of the `presentation` * * '@context', 'type' and 'issuanceDate' will be added automatically if omitted */ presentation: PresentationPayload; /** * Optional (only JWT) string challenge parameter to add to the verifiable presentation. */ challenge?: string; /** * Optional string domain parameter to add to the verifiable presentation. */ domain?: string; /** * Optional. The key handle ({@link IKey#kid}) from the internal database. */ keyRef?: string; } /** * Encapsulates the parameters required to create a * {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential} * * @beta This API is likely to change without a BREAKING CHANGE notice */ export interface ICreateVerifiableCredentialLDArgs { /** * The json payload of the Credential according to the * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model} * * The signer of the Credential is chosen based on the `issuer.id` property * of the `credential` * * '@context', 'type' and 'issuanceDate' will be added automatically if omitted */ credential: CredentialPayload; /** * Optional. The key handle ({@link IKey#kid}) from the internal database. */ keyRef?: string; } /** * Encapsulates the parameters required to verify a * {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential} * * @beta This API is likely to change without a BREAKING CHANGE notice */ export interface IVerifyCredentialLDArgs { /** * The json payload of the Credential according to the * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model} * * The signer of the Credential is chosen based on the `issuer.id` property * of the `credential` * */ credential: VerifiableCredential; /** * Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded. * * @default false */ fetchRemoteContexts?: boolean; } /** * Encapsulates the parameters required to verify a * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation} * * @beta This API is likely to change without a BREAKING CHANGE notice */ export interface IVerifyPresentationLDArgs { /** * The json payload of the Credential according to the * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model} * * The signer of the Credential is chosen based on the `issuer.id` property * of the `credential` * */ presentation: VerifiablePresentation; /** * Optional (only for JWT) string challenge parameter to verify the verifiable presentation against */ challenge?: string; /** * Optional (only for JWT) string domain parameter to verify the verifiable presentation against */ domain?: string; /** * Set this to true if you want the '@context' URLs to be fetched in case they are not pre-loaded. * * @default false */ fetchRemoteContexts?: boolean; } /** * 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. * * @beta This API is likely to change without a BREAKING CHANGE notice */ export declare type IRequiredContext = IAgentContext & Pick>; export declare type ContextDoc = { '@context': Record; }; //# sourceMappingURL=types.d.ts.map