UNPKG

xadesjs

Version:

XML Advanced Electronic Signatures (XAdES) implementation in TypeScript/JavaScript built on XMLDSIGjs

151 lines (150 loc) 4.97 kB
import { __decorate, __metadata } from "tslib"; import { XmlAttribute, XmlChildElement, XmlElement, XmlBase64Converter } from 'xml-core'; import { CanonicalizationMethod, DigestMethod, XmlSignature } from 'xmldsigjs'; import { Any } from './any.js'; import { EncapsulatedPKIData } from './encapsulated_pki_data.js'; import { XmlXades } from './xml.js'; import { XadesCollection, XadesObject } from './xml_base.js'; let Include = class Include extends XadesObject { }; __decorate([ XmlAttribute({ localName: XmlXades.AttributeNames.URI, defaultValue: '', required: true, }), __metadata("design:type", String) ], Include.prototype, "Uri", void 0); __decorate([ XmlAttribute({ localName: XmlXades.AttributeNames.ReferencedData, defaultValue: false, }), __metadata("design:type", Boolean) ], Include.prototype, "ReferencedData", void 0); Include = __decorate([ XmlElement({ localName: XmlXades.ElementNames.Include }) ], Include); export { Include }; let ReferenceInfo = class ReferenceInfo extends XadesObject { constructor() { super(...arguments); this.DigestMethod = new DigestMethod(); } }; __decorate([ XmlAttribute({ localName: XmlXades.AttributeNames.URI, defaultValue: '', }), __metadata("design:type", String) ], ReferenceInfo.prototype, "Uri", void 0); __decorate([ XmlAttribute({ localName: XmlXades.AttributeNames.Id, defaultValue: '', }), __metadata("design:type", String) ], ReferenceInfo.prototype, "Id", void 0); __decorate([ XmlChildElement({ required: true, parser: DigestMethod, }), __metadata("design:type", Object) ], ReferenceInfo.prototype, "DigestMethod", void 0); __decorate([ XmlChildElement({ required: true, localName: XmlSignature.ElementNames.DigestValue, namespaceURI: XmlSignature.NamespaceURI, prefix: XmlSignature.DefaultPrefix, converter: XmlBase64Converter, }), __metadata("design:type", Uint8Array) ], ReferenceInfo.prototype, "DigestValue", void 0); ReferenceInfo = __decorate([ XmlElement({ localName: XmlXades.ElementNames.ReferenceInfo }) ], ReferenceInfo); export { ReferenceInfo }; let ReferenceInfos = class ReferenceInfos extends XadesCollection { }; ReferenceInfos = __decorate([ XmlElement({ localName: 'ReferenceInfos', parser: ReferenceInfo, }) ], ReferenceInfos); export { ReferenceInfos }; let EncapsulatedTimeStamp = class EncapsulatedTimeStamp extends EncapsulatedPKIData { }; EncapsulatedTimeStamp = __decorate([ XmlElement({ localName: XmlXades.ElementNames.EncapsulatedTimeStamp }) ], EncapsulatedTimeStamp); export { EncapsulatedTimeStamp }; let EncapsulatedTimeStampCollection = class EncapsulatedTimeStampCollection extends XadesCollection { }; EncapsulatedTimeStampCollection = __decorate([ XmlElement({ localName: 'EncapsulatedPKIDatas', parser: EncapsulatedTimeStamp, }) ], EncapsulatedTimeStampCollection); export { EncapsulatedTimeStampCollection }; let XMLTimeStamp = class XMLTimeStamp extends Any { }; XMLTimeStamp = __decorate([ XmlElement({ localName: XmlXades.ElementNames.XMLTimeStamp }) ], XMLTimeStamp); export { XMLTimeStamp }; let XMLTimeStampCollection = class XMLTimeStampCollection extends XadesCollection { }; XMLTimeStampCollection = __decorate([ XmlElement({ localName: 'XMLTimeStampCollection', parser: XMLTimeStamp, }) ], XMLTimeStampCollection); export { XMLTimeStampCollection }; let GenericTimeStamp = class GenericTimeStamp extends XadesObject { }; __decorate([ XmlAttribute({ localName: XmlXades.AttributeNames.Id, defaultValue: '', }), __metadata("design:type", String) ], GenericTimeStamp.prototype, "Id", void 0); __decorate([ XmlChildElement({ parser: Include }), __metadata("design:type", Include) ], GenericTimeStamp.prototype, "Include", void 0); __decorate([ XmlChildElement({ parser: ReferenceInfos, noRoot: true, }), __metadata("design:type", ReferenceInfos) ], GenericTimeStamp.prototype, "ReferenceInfo", void 0); __decorate([ XmlChildElement({ parser: CanonicalizationMethod }), __metadata("design:type", CanonicalizationMethod) ], GenericTimeStamp.prototype, "CanonicalizationMethod", void 0); __decorate([ XmlChildElement({ parser: EncapsulatedTimeStampCollection, noRoot: true, }), __metadata("design:type", EncapsulatedTimeStampCollection) ], GenericTimeStamp.prototype, "EncapsulatedTimeStamp", void 0); __decorate([ XmlChildElement({ parser: XMLTimeStampCollection, noRoot: true, }), __metadata("design:type", XMLTimeStampCollection) ], GenericTimeStamp.prototype, "XMLTimeStamp", void 0); GenericTimeStamp = __decorate([ XmlElement({ localName: 'GenericTimeStamp' }) ], GenericTimeStamp); export { GenericTimeStamp };