di-wings
Version:
Aviary Tech's common library for decentralized identity
61 lines • 2.27 kB
TypeScript
import type { DocumentLoader, ProofJSON } from '..';
import { JsonWebKeyPair } from '../keypairs/JsonWebKey2020.js';
import { LinkedDataProof } from '../LDP/proof.js';
import { Buffer } from 'buffer/index.js';
export { createJWSSigner } from '../JWS/createSigner.js';
export { createJWSVerifier } from '../JWS/createVerifier.js';
export interface ISuite {
key?: JsonWebKeyPair;
getVerificationMethod: (options: any) => Promise<JsonWebKeyPair>;
deriveProof?: (options: any) => Promise<any>;
}
interface JWSProofJSON extends ProofJSON {
jws?: string;
}
export declare class JsonWebSignature2020LinkedDataProof extends LinkedDataProof {
jws: string | null;
constructor(type: string, proofPurpose: string, verificationMethod: string, created: string, challenge?: string | null, domain?: string | null, jws?: string | null);
toJSON(): JWSProofJSON;
}
export declare class JsonWebSignature2020Suite {
key: JsonWebKeyPair;
date: string;
type: string;
context: string;
verificationMethod?: string;
cryptosuite?: string;
useNativeCanonize: boolean;
constructor(options: {
key: JsonWebKeyPair;
date?: string;
});
getVerificationMethod({ proof, documentLoader }: any): Promise<JsonWebKeyPair>;
canonize(input: any, { documentLoader }: any): Promise<any>;
canonizeProof(proof: any, { documentLoader }: any): Promise<any>;
createVerifyData({ document, proof, documentLoader }: any): Promise<Buffer>;
createProof(document: any, purpose: string, documentLoader: DocumentLoader, options?: {
domain?: string;
challenge?: string;
}): Promise<{
context: string[];
proof: JWSProofJSON;
}>;
sign(verifyData: Uint8Array): Promise<string>;
verify(verifyData: Uint8Array, verificationMethod: JsonWebKeyPair, proof: {
jws: string;
}): Promise<{
verified: boolean;
error?: string;
}>;
verifyProof(proof: JWSProofJSON, document: any, documentLoader: DocumentLoader, options?: {
expansionMap?: any;
compactProof?: any;
}): Promise<{
verified: boolean;
errors?: undefined;
} | {
verified: boolean;
errors: any[];
}>;
}
//# sourceMappingURL=Suite.d.ts.map