UNPKG

xmldsigjs

Version:

XML Digital Signature implementation in TypeScript/JavaScript using Web Crypto API

12 lines (11 loc) 356 B
import { XE, XmlError } from 'xml-core'; import { keyValueRegistry } from './key_info_clause.registry.js'; export class KeyInfoClauseFactory { static create(type) { const ctor = keyValueRegistry.get(type); if (!ctor) { throw new XmlError(XE.KEY_INFO_CLAUSE_NOT_SUPPORTED, type); } return new ctor(); } }