import { verixyzLdSignature } from './ld-suites' import { TKeyType } from '@verixyz/core' /** * Initializes a list of verixyz-wrapped LD Signature suites and exposes those to the Agent Module */ export class LdSuiteLoader { constructor(options: { verixyzLdSignatures: verixyzLdSignature[] }) { options.verixyzLdSignatures.forEach((obj) => { this.signatureMap[obj.getSupportedverixyzKeyType()] = obj }) } private signatureMap: Record = {} getSignatureSuiteForKeyType(type: TKeyType) { const suite = this.signatureMap[type] if (suite) return suite throw new Error('No verixyz LD Signature Suite for ' + type) } getAllSignatureSuites() { return Object.values(this.signatureMap) } getAllSignatureSuiteTypes() { return Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType()) } }