@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
71 lines (70 loc) • 4.03 kB
text/typescript
import { Query, QueryOptions } from "../../storage/StorageService.mjs";
import { ClaimFormat } from "./models/ClaimFormat.mjs";
import { W3cCredentialRecord } from "./repository/W3cCredentialRecord.mjs";
import { W3cCredentialRepository } from "./repository/W3cCredentialRepository.mjs";
import "./repository/index.mjs";
import { W3cVerifiableCredential } from "./models/credential/W3cVerifiableCredential.mjs";
import { W3cPresentation } from "./models/presentation/W3cPresentation.mjs";
import { W3cVerifiablePresentation } from "./models/presentation/W3cVerifiablePresentation.mjs";
import { W3cVerifyCredentialResult, W3cVerifyPresentationResult } from "./models/W3cVerifyResult.mjs";
import "./models/index.mjs";
import { W3cCreatePresentationOptions, W3cSignCredentialOptions, W3cSignPresentationOptions, W3cStoreCredentialOptions, W3cVerifyCredentialOptions, W3cVerifyPresentationOptions } from "./W3cCredentialServiceOptions.mjs";
import { W3cJwtCredentialService } from "./jwt-vc/W3cJwtCredentialService.mjs";
import { W3cJsonLdCredentialService } from "./data-integrity/W3cJsonLdCredentialService.mjs";
import { AgentContext } from "../../agent/context/AgentContext.mjs";
import "../../agent/context/index.mjs";
//#region src/modules/vc/W3cCredentialService.d.ts
declare class W3cCredentialService {
private w3cCredentialRepository;
private w3cJsonLdCredentialService;
private w3cJwtCredentialService;
constructor(w3cCredentialRepository: W3cCredentialRepository, w3cJsonLdCredentialService: W3cJsonLdCredentialService, w3cJwtCredentialService: W3cJwtCredentialService);
/**
* Signs a credential
*
* @param credential the credential to be signed
* @returns the signed credential
*/
signCredential<Format extends ClaimFormat.JwtVc | ClaimFormat.LdpVc>(agentContext: AgentContext, options: W3cSignCredentialOptions<Format>): Promise<W3cVerifiableCredential<Format>>;
/**
* Verifies the signature(s) of a credential
*/
verifyCredential(agentContext: AgentContext, options: W3cVerifyCredentialOptions): Promise<W3cVerifyCredentialResult>;
/**
* Utility method that creates a {@link W3cPresentation} from one or more {@link W3cJsonLdVerifiableCredential}s.
*
* **NOTE: the presentation that is returned is unsigned.**
*
* @returns An instance of {@link W3cPresentation}
*/
createPresentation(options: W3cCreatePresentationOptions): Promise<W3cPresentation>;
/**
* Signs a presentation including the credentials it includes
*
* @param presentation the presentation to be signed
* @returns the signed presentation
*/
signPresentation<Format extends ClaimFormat.JwtVp | ClaimFormat.LdpVp>(agentContext: AgentContext, options: W3cSignPresentationOptions<Format>): Promise<W3cVerifiablePresentation<Format>>;
/**
* Verifies a presentation including the credentials it includes
*
* @param presentation the presentation to be verified
* @returns the verification result
*/
verifyPresentation(agentContext: AgentContext, options: W3cVerifyPresentationOptions): Promise<W3cVerifyPresentationResult>;
/**
* Writes a credential to storage
*
* @param record the credential to be stored
* @returns the credential record that was written to storage
*/
storeCredential(agentContext: AgentContext, options: W3cStoreCredentialOptions): Promise<W3cCredentialRecord>;
removeCredentialRecord(agentContext: AgentContext, id: string): Promise<void>;
getAllCredentialRecords(agentContext: AgentContext): Promise<W3cCredentialRecord[]>;
getCredentialRecordById(agentContext: AgentContext, id: string): Promise<W3cCredentialRecord>;
findCredentialsByQuery(agentContext: AgentContext, query: Query<W3cCredentialRecord>, queryOptions?: QueryOptions): Promise<W3cVerifiableCredential[]>;
findCredentialRecordByQuery(agentContext: AgentContext, query: Query<W3cCredentialRecord>): Promise<W3cVerifiableCredential | undefined>;
}
//#endregion
export { W3cCredentialService };
//# sourceMappingURL=W3cCredentialService.d.mts.map