@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
167 lines • 5.83 kB
text/typescript
import { DocumentLoader, JsonLdDoc, Proof, VerificationMethod } from "../proof-ops/jsonldUtil.mjs";
import { JwsLinkedDataSignature, JwsLinkedDataSignatureOptions } from "./JwsLinkedDataSignature.mjs";
//#region src/modules/vc/linked-data-proofs/signature-suites/Ed25519Signature2018.d.ts
type Ed25519Signature2018Options = Pick<JwsLinkedDataSignatureOptions, 'key' | 'proof' | 'date' | 'useNativeCanonize' | 'LDKeyClass'>;
export declare class Ed25519Signature2018 extends JwsLinkedDataSignature {
static CONTEXT_URL: string;
static CONTEXT: {
'@context': {
id: string;
type: string;
'@protected': boolean;
proof: {
'@id': string;
'@type': string;
'@container': string;
};
Ed25519VerificationKey2018: {
'@id': string;
'@context': {
'@protected': boolean;
id: string;
type: string;
controller: {
'@id': string;
'@type': string;
};
revoked: {
'@id': string;
'@type': string;
};
publicKeyBase58: {
'@id': string;
};
};
};
Ed25519Signature2018: {
'@id': string;
'@context': {
'@protected': boolean;
id: string;
type: string;
challenge: string;
created: {
'@id': string;
'@type': string;
};
domain: string;
expires: {
'@id': string;
'@type': string;
};
nonce: string;
proofPurpose: {
'@id': string;
'@type': string;
'@context': {
'@protected': boolean;
id: string;
type: string;
assertionMethod: {
'@id': string;
'@type': string;
'@container': string;
};
authentication: {
'@id': string;
'@type': string;
'@container': string;
};
capabilityInvocation: {
'@id': string;
'@type': string;
'@container': string;
};
capabilityDelegation: {
'@id': string;
'@type': string;
'@container': string;
};
keyAgreement: {
'@id': string;
'@type': string;
'@container': string;
};
};
};
jws: {
'@id': string;
};
verificationMethod: {
'@id': string;
'@type': string;
};
};
};
};
};
/**
* @param {object} options - Options hashmap.
*
* Either a `key` OR at least one of `signer`/`verifier` is required.
*
* @param {object} [options.key] - An optional key object (containing an
* `id` property, and either `signer` or `verifier`, depending on the
* intended operation. Useful for when the application is managing keys
* itself (when using a KMS, you never have access to the private key,
* and so should use the `signer` param instead).
* @param {Function} [options.signer] - Signer function that returns an
* object with an async sign() method. This is useful when interfacing
* with a KMS (since you don't get access to the private key and its
* `signer()`, the KMS client gives you only the signer function to use).
* @param {Function} [options.verifier] - Verifier function that returns
* an object with an async `verify()` method. Useful when working with a
* KMS-provided verifier function.
*
* Advanced optional parameters and overrides.
*
* @param {object} [options.proof] - A JSON-LD document with options to use
* for the `proof` node. Any other custom fields can be provided here
* using a context different from security-v2).
* @param {string|Date} [options.date] - Signing date to use if not passed.
* @param {boolean} [options.useNativeCanonize] - Whether to use a native
* canonize algorithm.
*/
constructor(options?: Ed25519Signature2018Options);
assertVerificationMethod(document: JsonLdDoc): Promise<void>;
/**
* Ensures the document to be signed contains the required signature suite
* specific `@context`, by either adding it (if `addSuiteContext` is true),
* or throwing an error if it's missing.
*
* @override
*
* @param {object} options - Options hashmap.
* @param {object} options.document - JSON-LD document to be signed.
* @param {boolean} options.addSuiteContext - Add suite context?
*/
ensureSuiteContext(options: {
document: JsonLdDoc;
addSuiteContext: boolean;
}): void;
/**
* Checks whether a given proof exists in the document.
*
* @override
*
* @param {object} options - Options hashmap.
* @param {object} options.proof - A proof.
* @param {object} options.document - A JSON-LD document.
* @param {object} options.purpose - A jsonld-signatures ProofPurpose
* instance (e.g. AssertionProofPurpose, AuthenticationProofPurpose, etc).
* @param {Function} options.documentLoader - A secure document loader (it is
* recommended to use one that provides static known documents, instead of
* fetching from the web) for returning contexts, controller documents,
* keys, and other relevant URLs needed for the proof.
*
* @returns {Promise<boolean>} Whether a match for the proof was found.
*/
matchProof(options: {
proof: Proof;
document: VerificationMethod;
purpose: any;
documentLoader?: DocumentLoader;
}): Promise<boolean>;
}
//#endregion
//# sourceMappingURL=Ed25519Signature2018.d.mts.map