mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
* Add ERROR_STATE flag * added prop options and func timeFormatter added property `options`, which can be found in [the code](15fc4b62f5/smoothie.js (L270)). Even though it's not mentioned in the docs, it useful to be able to access these options after chart is initialized when you want to change appearance in real tme. added function `timeFormatter`, which is mentioned in [right here, in the definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/smoothie/smoothie.d.ts#L127) and can be found in [the code](15fc4b62f5/smoothie.js (L795)) * Fix type errors * Added typings for css-modules-require-hook * Remove spaces * Added semver, added explicit ignore callback, unified array definition and removed one time interface * Overwriting method signature * Correct parameter type * Add MobilePhoneLocale * Add isMobilePhone tests * Type definitions for bit-array * Add emit for cluster * To use the definition inline * [logat.d.ts] Type definition for node module 'logat' (#11485) * Create logat.d.ts * Create logat-tests.ts * Update logat-tests.ts * Update logat-tests.ts * Update logat.d.ts * updated logat test * updated type definiton * [dateformat.d.ts] Add definitions for dateformat * Remove the ES6 module hack * Yayson definitions (#11484) * Add yayson Store typings * Add yayson Store tests * Improve yayson coverage * Specify version in yayson definition * Remove yayson generics and tidy * Changed namespace from angularTouchspin to angular.touchspin (#11414) * [perfect-scrollbar.d.ts] Add definitions for perfect-scrollbar (#11486) * Added types for klaw (#11492) * Added types for klaw * addressed pr comments and `tsfmt -r klaw/*.ts` * add typings for onselected and onunselected methods, refs #11493 (#11496) * Improve through2 declarations (#11499) * [through2] Fix typos * [through2] Change return types to stream.Transform `through2` creates `stream.Transform`-flavored streams, so switching the return types to `stream.Transform` gives us richer typing information than using `NodeJS.ReadWriteStream`, which is missing methods (e.g. `stream.Transform#push`) and the ability to use object mode. * [through2] Add through2.ctor method * [through2] Update header and docs * Add module declaration to crossfilter so that it can be explicitly imported (#11521) * Add typings for murmurhash3js * fix module import to be ES6 compliant * newline at EOF * [rethinkdb] Adds missing promise methods to Cursor and Connection * [rethinkdb] Applied TypeScript formatting to the file * [rethinkdb] Adds types to Cursor methods * webpack - HotModuleReplacementPlugin has opts arg * [openlayers] forEachFeatureAtPixel can return a value See doc http://openlayers.org/en/latest/apidoc/ol.Map.html#forEachFeatureAtPixel * Update react.d.ts Added myself as an author so I get notifications of PRs / updates from GitHub. * vue: fixed definition for activate() in ComponentOption * Fix error that came using typescript 2 This error come when try compile with typescript 2 kue.d.ts(13,3): error TS2440: Import declaration conflicts with local declaration of 'redis' * path can be string or a hash of options As per http://restify.com/#client-api it states: > Note that all further documentation refers to the "short-hand" > form of methods like get/put/del which take a string path. You > can also pass in an object to any of those methods with extra > params (notably headers): So the path can be either a string or a hash of options. * Add CognitoIdentity into aws-sdk * Font advanced config options added (for v2.0.6+) * Add missing slider parameters * Add backspaceToRemoveMessage prop * fixup! path can be string or a hash of options * add request.body (#11395) * add request.body * Update koa-bodyparser.d.ts According to the documentation of `koa-bodyparser`: ```javascript // the parsed body will store in this.request.body // if nothing was parsed, body will be an empty object {} ctx.body = ctx.request.body; ``` Therefore the `body` property will exit in the `request` object. Changing the `body` property from optional to required can also fix the conflict problem in Koa's declaration file: ```ts class Koa extend Request, Response {} ``` * Implement tilebelt definition (#11495) * Add import test (#11476) * [validator] Add new stuff which document not mentioned (#11498) * Add new stuff which document not mentioned * Add related test * http.ServerRequest => http.IncomingMessage (#11500) * [node] Add events for dgram (#11501) * Add events for dgram * Add tests for dgram * Correct dgram.RemoteInfo interface * Correct emit * Correct emit * [node] Add events for tls.Server and tls.TLSSocket (#11502) * Add events for tls.Server * Add tests for tls.Server * Add tests for TLSSocket * Add events for TLSSocket * [react-router] Update getComponents signatures (#11319) Update `getComponent(s)` all over the place. See #9530 for more info. * Updated jquery.dataTables for 1.10.7. (#11408) * Updated jquery.dataTables for 1.10.7. Version release notes: https://cdn.datatables.net/1.10.7/ * Added any() * Added i18n() Note: selector-modifier support currently exists with interface ObjectSelectorModifier. * Added strong variable typing in jquery.dataTables-tests.ts * For parameter 'def', replaced 'Object' data type with 'any' per TypeScript declaration file guidance. * [HAPI] Add `IStrictSessionHandler` (#11523) * Fix #11519 * Added FileResizeOptions for the changed resize function call * getEvent should not be set to void it should return a value (#11135) * getEvent should not be set to void it should return a value * Add type to getActionData for testing * pnotify Add type fpr notice styling and state * fix pnotify test * Remove Generics and replaces by return any * convert space tp tabs * Add barTintColor to NavigatorIOS (#11522) * GreenSock TweenMax TweenLite config Object typed refs #11265 (#11310) * refs #9944 * refs #11265 * refs #11265 * Call strategy with only mode or options (#11466) * Call strategy with only mode or options * Refactor `server.auth.strategy` * - add client.exists([params, [callback]]) (#11515) * Update to Electron 1.4.1 (#11481) * Correct fs.createWriteStream (#11560) * add declaration file for weapp (#11554) * add declaration file of weapp * rename "weapp" to "weapp-api" rename "weapp" to "weapp-api" to avoid naming conflicts * Added more methods to Turf (#11558) * Added more methods to Turf - circle - geojsonType - propReduce - coordAll - tesselate * Replace Object with GeoJSON * Implemented cheap-ruler definition * Remove GeoJSON dependency * Cheap-ruler fixes - Removed GeoJSON from tests - Added return-type to fromTile * Update JSDocs cheap-ruler Update based on comments https://github.com/mapbox/cheap-ruler/pull/20 - Removed `{@name}` - Changed {Object} to {CheapRuler} * [bluebird] document .suppressUnhandledRejections http://bluebirdjs.com/docs/api/suppressunhandledrejections.html * Add typings for shallowequal. * URIjs fix .joinPaths() the .joinPaths function is on URIStatic, not an instance of URI https://medialize.github.io/URI.js/docs.html#static-joinPaths * set document id property to be optional * Fixed type of onchallenge * feat(CKEditor): Add missing typings for `focusManager` * sequelize: fix return value type of Model.findOrXXX methods http://docs.sequelizejs.com/en/latest/api/model/#findorinitialize-promiseinstance-initialized * Added type Point for simplicity Comments from @vladima * add interface for mongoose document optional properties * optional constructor for RecurrenceRule * fix the framework type * add parameter support in initialize() * add callback parameter * Added promise() to the JQueryPromise<T> interface jQuery allows calling a promise() function on a Promise object. Updated the interface to reflect this. * optional authorize * add contains fn * Update ip-tests.ts * Added tests for the promise() method on jqXHR Ensures that the jqXHR object exposes a standard promise because it implements the JQueryPromise<T> interface. * angular-dynamic-local Add "storageKey" definition (#11566) Add "storageKey" definition cf : https://github.com/lgalfaso/angular-dynamic-locale/blob/master/src/tmhDynamicLocale.js#L197 * Added declare module for easier including. (#11562) * Adding recompose@0.20.2 typings (#11577) * Added typings for change-emitter@0.1.2 * Adding recompose@0.20.2 typings * Update typescript definition for selectize to 0.12.13 (#11570) * [react-router-redux] Update action payload type (#11559) The payload for React Redux Router action is a location object. For more information look at the source code [here](https://github.com/reactjs/react-router-redux/blob/master/src/sync.js#L95) * [openlayers] Rewrite for openlayers 3.18.2 (#11339) * Added missing config options for release v2.0.8 (#11595) * [graphql] Create graphql (#11598) * Complete graphql/language * Update graphql/error * Update graphql.d.ts * Create graphql-tests.ts * Update graphql/type * Update graphql/error and graphql/execution * Remove null type * Remove comma * ej typings v14.3.0.49 added (#11597) * ej typings v14.3.0.49 added * jquery dependent added * react-bootstrap-table: add ignoreSinglePage option (#11581) As shown in the [docs](http://allenfang.github.io/react-bootstrap-table/docs.html) ``` ignoreSinglePage : Bool Enable to ignore the pagination if only one page, default is false. ``` * There is no INST_EDGE_FALLING exported const but INT_EDGE_FALLING (#11603) Exporting correct `const` `INST_EDGE_FALLING` -> `INT_EDGE_FALLING` * Complete HighchartsBarStates interface. Add Color interface (#11505) - HighchartsBarStates interfaces didn't include `borderColor` and `color` properties, as documented in http://api.highcharts.com/highcharts/plotOptions.bar.states.hover - A Color interface was added, since the documentation refers many times to `Color` as a type. This colors can be either a string or a gradient, as stated in http://www.highcharts.com/docs/chart-design-and-style/colors. The introduction of this type should help alleviating the errors currently present where certain "color" properties are only allowed to be strings. * Add definition for swagger-jsdoc (#11298) * Add definition for swagger-jsdoc * Update files * Remove interface and use any instead for options, fix tests * Fix Usage example * Add definitions for: "bunyan-config", "express-mung", "node-vitalsigns" and "memwatch-next" (#11285) * Add definition for "bunnymq". * Add definition for "strftime". * Add definitions for: "bunyan-config", "express-mung" and "node-vitalsigns". * Add definitions for: "bunyan-config", "express-mung" and "node-vitalsigns". * Add definition for "memwatch-next". * Fix project URL address. * Rename "node-vitalsigns" to "vitalsigns". * Update definitions. * Use {} instead of "Object" type. Remove unnecessary namespace for "memwatch-next" definition. Rewrite "bunyan-config" definition. * Replace "Object" by "{}". * (helmet): change to namespace and export interfaces (#11585) * Replace reference to deprecated http.ClientResponse with newer http.IncomingMessage (#11596) * [cheerio] Adds missing load(CheerioElement) (#11520) * add id (#11619) * add id * remove readonly * add touch after * fix typo * change Topic property latch to boolean type (#11607) * Add AngularJS linky filter definition (#11507) * Support universal modules for SAT (#11632) * changed versionKey in Schema spec to string * better structure * Add argumentless Q() * add definitions for tz-format (#11565) * add definitions for tz-format * fix return type * Create typings for ngeohash (#11634) * [nprogress] Update configuration properties (#11627) Update a couple of nprogress configuration properties: * `ease` is renamed to `easing`. * `trickleRate` is removed. * `parent` is added. More info [here](https://github.com/rstacruz/nprogress/blob/master/nprogress.js#L19-L31) * Fix leaflet L.GeoJSON.addData et al (#11590) (#11591) * NotificationAlertOptions can have a subtitle (#11638) * Parse5 comment data (#11649) * Add test for data * Update parse5.d.ts * feat: add localforage-cordovasqlitedriver definition (#11650) * Fix export for "bunyan-config" and improve definitions (#11653) * Fix export for "bunyan-config". * Update definitions. Replace "Object" to "{}" type. Add "express" property in "VitalSigns" class. * Update ejs.d.ts (#11467) This typings give an error when templating HTML Error: Cannot invoke an expression whose type lacks a call signature. my code ```javascript var templateFunction = EJS.compile(SOMESTRTEMPLATE); myDomElement.innerHTML = templateFunction(someDataObject) // <= ERROR ``` * Added hyperscript module (#11661) * update parsimmon typings for parsimmon 0.9.2 (#11648) * update parsimmon typings for parsimmon 0.9.2 * add overloads for parsimmon#seq * code review * Fix babel-traverse buildCodeFrameError signature (#11654) The Error argument is not an error instance, instead it is a constructor function that returns an error instance. Additionally, the constructor function is optional, by default SyntaxError is used * Added type definition for riot library (#11664) * Added type definition for riot * Added type information for compile function, version, settings and template error handler * Updated namespace name Riot -> riot * Renamed riot-test.ts -> riot-tests.ts * Add definitions for pem (#11666) https://github.com/andris9/pem * Added hapi-decorators.d.ts (#11668) * Add missing each, and correct type of Date.now() (#11670) * Add definitions for spdy (#11672) https://github.com/indutny/node-spdy * Allow interface to be named (#11673) > error TS4023: Exported variable 'DevTools' has or is using name 'IDevTools' from external module "/Users/remojansen/CODE/forks/redux-bootstrap/node_modules/@types/redux-devtools/index" but cannot be named. * Add array methods to LoDashExplicitArrayWrapper to match LoDashImplicitArrayWrapper. (#11518) * add transducers-js types w/ tests (#11676) * Fix redeclare block-scoped Base64 (#11677) Issue found by https://github.com/dankogai/js-base64/issues/38#issuecomment-250999729 * added seed, randomTests and randomizeTests property (#11678) * Add toJSON method to signature (#11682) * Fix instance of cropperjs for library version > 0.8 (#11490) * Updated fbsdk definitions for authentication responses and api calls. (#11686) Fixes #11327 May help with #11007 * Create typings for jquery-alertable (#11642) * ADD: definition file for the moment-duration-format library (#11557) * Update d.ts file for Dialog API updates (#11526) * Add support for Highcharts modules: offline exporting and boost (#11030) * Create highcharts-modules-offline-exporting * Rename highcharts-modules-offline-exporting to highcharts-modules-offline-exporting.d.ts * Create highcharts-modules-boost.d.ts * Added cash-js.d.ts File (#10765) * Added cash-js.d.ts File * Fixed Link break issue * Renamed from cash-js to cash * Fixed the module name as suggested * Update headroom.d.ts (#11313) notBottom missing from definition * Added the definition for the npm package simple-url-cache (#11296) * Added the definition for the npm package simple-url-cache https://www.npmjs.com/package/simple-url-cache * - Some problems with shells.js missing the touch fucntion deifnition * More details on the touch parameters - nice screenshot btw * Updated the RowMethods interface (#11665) * Updated the RowMethods interface This Interface was missing the Definition of the id() method. Link to official documentation: https://datatables.net/reference/api/row().id() * Changed indentation from tabs to spaces * Added definition file for Defaults Js Library (#11451) * Added missing className property to CardProps (#10823) The className property for CardPros is missing, so using it like <Card className={this.myClass}>...</Card> is not possible. * Add missing perMessageDeflate server option (#11380) * Add missing class AgendaView (#11371) * Add missing class AgendaView * Move class to kendo.ui namespace * Change path to interface * Add static fn * Add static extend * Add static extend * Resolve conflicts * adds system faker methods (#11432) * added definitions for SharePoint file Search.ClientControls.js (#11652) * added definitions for SharePoint file Search.ClientControls.js (Srch namespace, heavily used in Search Display Templates) * --noImplicitAny compatibility fixes also small improvements * more fixes for --noImplicitAny * Adding union type for offset (#11689) * add type definitions for msgpack-lite package. (#11690) * Updating jasmine to version 2.5 (#11688) * Updating jasmine to version 2.5 * Fixing 2 small errors in the update of jasmine * withMock now takes a "() => void" * fixed the withMock syntax error * number added as type to seed function * add missing isEmpty function (#11698) * Added type definitions for terminal-menu (#11697) * Update THREE.js definitions to r81 (#11679) * Update THREE.js definitions to r81 * Update test_unit_maths.ts to r81 * Update version in header to r81 * UPDATE localForage type definitions (#11702) * Update Google Maps API type definition to 3.25 (#11626) * Update Google Maps Places Library definition - According to the Places Library documentation (https://goo.gl/EJFiuQ), certain fields are being removed - I have aligned the Places Library definitions with the API reference (https://goo.gl/kYoi9V) and added deprecation comments for the old properties as they are still accepted until February - I could not find an official deprecation attribute or similar for Typescript definitions so I just left a comment * Update the API version in the header * Apply API changes between version 3.20 and 3.25 - Used the Google Maps API release notes (https://goo.gl/nRUZGJ) as a reference * Fix inconsistant type definition * Override ol.layer.Vector#getSource() (#11703) Reference: http://openlayers.org/en/latest/apidoc/ol.layer.Vector.html * Replace number[] by [number, number] (#11704) * [lodash]: memoize.Cache expects construcor (#11707) https://lodash.com/docs/4.15.0#memoize * Added jquery.flagstrap.js definition suport (#11710) * apply declaration merging (#10900) * Update material-ui.d.ts (#11353) Expose ThemePalette interface. * Change ChartAxisXOptions (#11449) Change the type for minimum and maximum options in ChartAxisXOptions to support both number and Date. * Improve support for arrays of promises (#11685) * Alias IWhenable<T> = IPromise<T> | T * Allow all Q functions to work with either promises or raw values * Allow functions expecting arrays to take promises for arrays Q.race is deliberately excluded, as this does not support this type of argument. * scheduler options (#11543) * Added missing move function (#11563) * Added missing move function Added missing move function in typings so that the move function is recognised by the IDE and the compiler. * Minor derp here * Add missing Valdr typings for validation results and constraints (#11636) * Add missing Valdr types Add ValdrValidationConstraints and ValdrValidationResult typings * Refine Valdr-message typings Set a more refined type to messages instead of any * Expand Valdr typings tests Expand tests to include added typings for ValdrValidationResult and ValdrConstraints * Fix spacing Replace tabs by spaces * Rename vars in test Rename vars to make test clearer * Fix TS issues Added missing types * Remove undefined In TS by default null and undefined are subtypes of all other types * Fix wrong type Add missing namespace * Fix wrong version number Set version to only numbers * Fix wrong version number Keep version to only numbers * Use douple quotes * Remove invalid triple-slash references * Add tsconfig.json files and move main file to index.d.ts * Rename file to index.d.ts * Remove tscparams files * Remove unused file * Remove invalid references * Move hapi-decorator to use index.d.ts * Switch to use external modules * Correctely extend angular * Fix tsconfig.json * Remove unused references * HACK: Put back /// reference tag.
1086 lines
34 KiB
TypeScript
1086 lines
34 KiB
TypeScript
// Type definitions for xadesjs v1.0.0
|
|
// Project: https://github.com/PeculiarVentures/xadesjs
|
|
// Definitions by: Stepan Miroshin <https://github.com/microshine>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
/**
|
|
* A pure Javascript implementation of XMLDSIG and XAdES based on Web Crypto https://xadesjs.com
|
|
* v1.0.0
|
|
*/
|
|
|
|
declare namespace xadesjs {
|
|
|
|
type PromiseType = any;
|
|
|
|
const APPLICATION_XML: string;
|
|
|
|
class XmlError extends Error {
|
|
stack: any;
|
|
constructor(code: XE, ...args: any[]);
|
|
}
|
|
|
|
enum XE {
|
|
NONE = 0,
|
|
NULL_REFERENCE = 1,
|
|
METHOD_NOT_IMPLEMENTED = 2,
|
|
METHOD_NOT_SUPPORTED = 3,
|
|
PARAM_REQUIRED = 4,
|
|
CONVERTER_UNSUPPORTED = 5,
|
|
ELEMENT_MALFORMED = 6,
|
|
CRYPTOGRAPHIC = 7,
|
|
CRYPTOGRAPHIC_NO_MODULE = 8,
|
|
CRYPTOGRAPHIC_UNKNOWN_TRANSFORM = 9,
|
|
ALGORITHM_NOT_SUPPORTED = 10,
|
|
ALGORITHM_WRONG_NAME = 11,
|
|
XML_EXCEPTION = 12,
|
|
}
|
|
|
|
interface CryptoEx extends Crypto {
|
|
name: string;
|
|
}
|
|
|
|
class Application {
|
|
/**
|
|
* Sets crypto engine for the current Application
|
|
* @param {string} name
|
|
* @param {Crypto} crypto
|
|
* @returns void
|
|
*/
|
|
static setEngine(name: string, crypto: Crypto): void;
|
|
/**
|
|
* Gets the crypto module from the Application
|
|
*/
|
|
static crypto: CryptoEx;
|
|
static isNodePlugin(): boolean;
|
|
}
|
|
|
|
enum XmlNodeType {
|
|
None = 0,
|
|
Element = 1,
|
|
Attribute = 2,
|
|
Text = 3,
|
|
CDATA = 4,
|
|
EntityReference = 5,
|
|
Entity = 6,
|
|
ProcessingInstruction = 7,
|
|
Comment = 8,
|
|
Document = 9,
|
|
DocumentType = 10,
|
|
DocumentFragment = 11,
|
|
Notation = 12,
|
|
Whitespace = 13,
|
|
SignificantWhitespace = 14,
|
|
EndElement = 15,
|
|
EndEntity = 16,
|
|
XmlDeclaration = 17,
|
|
}
|
|
|
|
interface IXmlSerializable {
|
|
Prefix: string;
|
|
/**
|
|
* Writes object to XML node
|
|
* @returns Node
|
|
*/
|
|
GetXml(): Node;
|
|
/**
|
|
* Reads XML from string
|
|
* @param {Node} node
|
|
* @returns void
|
|
*/
|
|
LoadXml(node: Node): void;
|
|
}
|
|
|
|
abstract class XmlObject implements IXmlSerializable {
|
|
protected m_prefix: string;
|
|
Prefix: string;
|
|
protected GetPrefix(): string;
|
|
GetXml(): Node;
|
|
GetXml(document: Document): Node;
|
|
LoadXml(node: Node): void;
|
|
toString(): string;
|
|
protected getAttribute(xel: Element, attribute: string): string;
|
|
}
|
|
|
|
const DEFAULT_ROOT_NAME: string;
|
|
function IsEqualsEmptyStrings(s1: string, s2: string): boolean;
|
|
/**
|
|
* Creates new instance of XmlDocument with given name of root element
|
|
* @param {string} root Name of root element
|
|
* @param {string} namespaceUri
|
|
* @param {string} prefix
|
|
* @returns Document
|
|
*/
|
|
function CreateDocument(root?: string, namespaceUri?: string, prefix?: string): Document;
|
|
/**
|
|
* Returns signle Node from given Node
|
|
* @param {Node} node
|
|
* @param {string} path
|
|
* @returns Node
|
|
*/
|
|
function SelectSingleNode(node: Node, path: string): Node;
|
|
|
|
function findAttr(node: Node, localName: string, nameSpace?: string): Attr;
|
|
function findFirst(doc: Node, xpath: string): Node;
|
|
function findChilds(node: Node, localName: string, nameSpace?: string): Node[];
|
|
interface IAssocArray {
|
|
[index: string]: string;
|
|
}
|
|
function encodeSpecialCharactersInAttribute(attributeValue: string): string;
|
|
function encodeSpecialCharactersInText(text: string): string;
|
|
function SelectNamespaces(node: Element): Node[];
|
|
|
|
class Convert {
|
|
static ToBase64UrlString(text: string): string;
|
|
static FromBase64UrlString(base64UrlText: string): string;
|
|
static ToBase64String(text: string): string;
|
|
static FromBase64String(base64Text: string): string;
|
|
static Base64UrlToBase64(base64url: string): string;
|
|
static Base64ToBase64Url(base64: string): string;
|
|
static ToBufferUtf8String(text: string): Uint8Array;
|
|
static FromBufferUtf8String(buffer: Uint8Array): string;
|
|
static ToBufferString(text: string): Uint8Array;
|
|
static FromBufferString(buffer: ArrayBuffer): string;
|
|
static FromBufferString(buffer: Uint8Array): string;
|
|
}
|
|
|
|
interface IAlgorithm {
|
|
algorithm: Algorithm;
|
|
xmlNamespace: string;
|
|
getAlgorithmName(): string;
|
|
}
|
|
interface IHashAlgorithm extends IAlgorithm {
|
|
getHash(xml: string): PromiseType;
|
|
}
|
|
interface IHashAlgorithmConstructable {
|
|
new (): IHashAlgorithm;
|
|
}
|
|
abstract class XmlAlgorithm implements IAlgorithm {
|
|
algorithm: Algorithm;
|
|
xmlNamespace: string;
|
|
getAlgorithmName(): string;
|
|
}
|
|
abstract class HashAlgorithm extends XmlAlgorithm implements IHashAlgorithm {
|
|
getHash(xml: string): PromiseType;
|
|
}
|
|
interface ISignatureAlgorithm extends IAlgorithm {
|
|
getSignature(signedInfo: string, signingKey: CryptoKey, algorithm: Algorithm): PromiseType;
|
|
verifySignature(signedInfo: string, key: CryptoKey, signatureValue: string, algorithm?: Algorithm): PromiseType;
|
|
}
|
|
interface ISignatureAlgorithmConstructable {
|
|
new (): ISignatureAlgorithm;
|
|
}
|
|
abstract class SignatureAlgorithm extends XmlAlgorithm implements ISignatureAlgorithm {
|
|
/**
|
|
* Sign the given string using the given key
|
|
*/
|
|
getSignature(signedInfo: string, signingKey: CryptoKey, algorithm: Algorithm): PromiseType;
|
|
/**
|
|
* Verify the given signature of the given string using key
|
|
*/
|
|
verifySignature(signedInfo: string, key: CryptoKey, signatureValue: string, algorithm?: Algorithm): PromiseType;
|
|
}
|
|
|
|
const SHA1: string;
|
|
const SHA224: string;
|
|
const SHA256: string;
|
|
const SHA384: string;
|
|
const SHA512: string;
|
|
const SHA1_NAMESPACE: string;
|
|
const SHA224_NAMESPACE: string;
|
|
const SHA256_NAMESPACE: string;
|
|
const SHA384_NAMESPACE: string;
|
|
const SHA512_NAMESPACE: string;
|
|
class Sha1 extends HashAlgorithm {
|
|
algorithm: {
|
|
name: string;
|
|
};
|
|
xmlNamespace: string;
|
|
}
|
|
class Sha224 extends HashAlgorithm {
|
|
algorithm: {
|
|
name: string;
|
|
};
|
|
xmlNamespace: string;
|
|
}
|
|
class Sha256 extends HashAlgorithm {
|
|
algorithm: {
|
|
name: string;
|
|
};
|
|
xmlNamespace: string;
|
|
}
|
|
class Sha384 extends HashAlgorithm {
|
|
algorithm: {
|
|
name: string;
|
|
};
|
|
xmlNamespace: string;
|
|
}
|
|
class Sha512 extends HashAlgorithm {
|
|
algorithm: {
|
|
name: string;
|
|
};
|
|
xmlNamespace: string;
|
|
}
|
|
|
|
// RSA PKCS1
|
|
|
|
const RSA_PKCS1: string;
|
|
const RSA_PKCS1_SHA1_NAMESPACE: string;
|
|
const RSA_PKCS1_SHA224_NAMESPACE: string;
|
|
const RSA_PKCS1_SHA256_NAMESPACE: string;
|
|
const RSA_PKCS1_SHA384_NAMESPACE: string;
|
|
const RSA_PKCS1_SHA512_NAMESPACE: string;
|
|
|
|
class RsaPkcs1Sha1 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPkcs1Sha224 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPkcs1Sha256 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPkcs1Sha384 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPkcs1Sha512 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
|
|
// RSA PSS
|
|
|
|
const RSA_PSS: string;
|
|
const RSA_PSS_WITH_PARAMS_NAMESPACE: string;
|
|
const RSA_PSS_WITH_PARAMS_MGF1_NAMESPACE: string;
|
|
|
|
class RsaPssSha1 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPssSha224 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPssSha256 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPssSha384 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class RsaPssSha512 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class PssAlgorithmParams extends XmlObject {
|
|
private m_digest_method;
|
|
private m_salt_length;
|
|
private m_mgf;
|
|
private element;
|
|
dsPrefix: string;
|
|
DigestMethod: string;
|
|
SaltLength: number;
|
|
MGF: string;
|
|
GetXml(): Element;
|
|
LoadXml(value: Element): void;
|
|
}
|
|
|
|
// HMAC
|
|
|
|
const HMAC_ALGORITHM: string;
|
|
const HMAC_SHA1_NAMESPACE: string;
|
|
const HMAC_SHA256_NAMESPACE: string;
|
|
const HMAC_SHA384_NAMESPACE: string;
|
|
const HMAC_SHA512_NAMESPACE: string;
|
|
|
|
class HmacSha1 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class HmacSha256 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class HmacSha384 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class HmacSha512 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
|
|
// ECDSA
|
|
|
|
const ECDSA_SIGN_ALGORITHM: string;
|
|
const ECDSA_SHA1_NAMESPACE: string;
|
|
const ECDSA_SHA224_NAMESPACE: string;
|
|
const ECDSA_SHA256_NAMESPACE: string;
|
|
const ECDSA_SHA384_NAMESPACE: string;
|
|
const ECDSA_SHA512_NAMESPACE: string;
|
|
class EcdsaSha1 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class EcdsaSha224 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class EcdsaSha256 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class EcdsaSha384 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
class EcdsaSha512 extends SignatureAlgorithm {
|
|
algorithm: any;
|
|
xmlNamespace: string;
|
|
}
|
|
|
|
/**
|
|
* Represents an <X509Certificate> element.
|
|
*/
|
|
class X509Certificate {
|
|
protected raw: Uint8Array;
|
|
protected cert_simpl: any;
|
|
protected publicKey: CryptoKey;
|
|
constructor(rawData?: Uint8Array);
|
|
/**
|
|
* Loads X509Certificate from DER data
|
|
* @param {Uint8Array} rawData
|
|
*/
|
|
protected LoadFromRawData(rawData: Uint8Array): void;
|
|
/**
|
|
* Gets the public key from the X509Certificate
|
|
*/
|
|
PublicKey: CryptoKey;
|
|
/**
|
|
* Returns DER raw of X509Certificate
|
|
*/
|
|
GetRawCertData(): Uint8Array;
|
|
/**
|
|
* Returns public key from X509Certificate
|
|
* @param {Algorithm} algorithm
|
|
* @returns PromiseType
|
|
*/
|
|
exportKey(algorithm: Algorithm): PromiseType;
|
|
}
|
|
|
|
enum X509IncludeOption {
|
|
None = 0,
|
|
EndCertOnly = 1,
|
|
ExcludeRoot = 2,
|
|
WholeChain = 3,
|
|
}
|
|
interface X509IssuerSerial {
|
|
issuerName: string;
|
|
serialNumber: string;
|
|
}
|
|
/**
|
|
* Represents an <X509Data> subelement of an XMLDSIG or XML Encryption <KeyInfo> element.
|
|
*/
|
|
class KeyInfoX509Data extends XmlObject implements KeyInfoClause {
|
|
|
|
constructor();
|
|
constructor(rgbCert: Uint8Array);
|
|
constructor(cert: X509Certificate);
|
|
/**
|
|
* Gets public key of the X509Data
|
|
*/
|
|
Key: CryptoKey;
|
|
importKey(key: CryptoKey): PromiseType;
|
|
/**
|
|
* Exports key from X509Data object
|
|
* @param {Algorithm} alg
|
|
* @returns PromiseType
|
|
*/
|
|
exportKey(alg: Algorithm): PromiseType;
|
|
/**
|
|
* Gets a list of the X.509v3 certificates contained in the KeyInfoX509Data object.
|
|
*/
|
|
Certificates: X509Certificate[];
|
|
/**
|
|
* Gets or sets the Certificate Revocation List (CRL) contained within the KeyInfoX509Data object.
|
|
*/
|
|
CRL: Uint8Array;
|
|
/**
|
|
* Gets a list of X509IssuerSerial structures that represent an issuer name and serial number pair.
|
|
*/
|
|
IssuerSerials: X509IssuerSerial[];
|
|
/**
|
|
* Gets a list of the subject key identifiers (SKIs) contained in the KeyInfoX509Data object.
|
|
*/
|
|
SubjectKeyIds: Uint8Array[];
|
|
/**
|
|
* Gets a list of the subject names of the entities contained in the KeyInfoX509Data object.
|
|
*/
|
|
SubjectNames: string[];
|
|
/**
|
|
* Adds the specified X.509v3 certificate to the KeyInfoX509Data.
|
|
* @param {X509Certificate} certificate
|
|
* @returns void
|
|
*/
|
|
AddCertificate(certificate: X509Certificate): void;
|
|
/**
|
|
* Adds the specified issuer name and serial number pair to the KeyInfoX509Data object.
|
|
* @param {string} issuerName
|
|
* @param {string} serialNumber
|
|
* @returns void
|
|
*/
|
|
AddIssuerSerial(issuerName: string, serialNumber: string): void;
|
|
/**
|
|
* Adds the specified subject key identifier (SKI) to the KeyInfoX509Data object.
|
|
* @param {string | Uint8Array} subjectKeyId
|
|
* @returns void
|
|
*/
|
|
AddSubjectKeyId(subjectKeyId: string): void;
|
|
AddSubjectKeyId(subjectKeyId: Uint8Array): void;
|
|
/**
|
|
* Adds the subject name of the entity that was issued an X.509v3 certificate to the KeyInfoX509Data object.
|
|
* @param {string} subjectName
|
|
* @returns void
|
|
*/
|
|
AddSubjectName(subjectName: string): void;
|
|
/**
|
|
* Returns an XML representation of the KeyInfoX509Data object.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Parses the input XmlElement object and configures the internal state of the KeyInfoX509Data object to match.
|
|
* @param {Element} element
|
|
* @returns void
|
|
*/
|
|
LoadXml(element: Element): void;
|
|
}
|
|
|
|
interface IJwkRsa {
|
|
alg: string;
|
|
kty: string;
|
|
e: string;
|
|
n: string;
|
|
ext: boolean;
|
|
}
|
|
/**
|
|
* Represents the <RSAKeyValue> element of an XML signature.
|
|
*/
|
|
class RsaKeyValue extends XmlObject implements KeyInfoClause {
|
|
/**
|
|
* Gets or sets the instance of RSA that holds the public key.
|
|
*/
|
|
Key: CryptoKey;
|
|
/**
|
|
* Gets the algorithm of the public key
|
|
*/
|
|
Algorithm: ISignatureAlgorithm;
|
|
/**
|
|
* Gets the Modulus of the public key
|
|
*/
|
|
Modulus: Uint8Array;
|
|
/**
|
|
* Gets the Exponent of the public key
|
|
*/
|
|
Exponent: Uint8Array;
|
|
constructor();
|
|
/**
|
|
* Imports key to the RSAKeyValue object
|
|
* @param {CryptoKey} key
|
|
* @returns PromiseType
|
|
*/
|
|
importKey(key: CryptoKey): PromiseType;
|
|
/**
|
|
* Exports key from the RSAKeyValue object
|
|
* @param {Algorithm} alg
|
|
* @returns PromiseType
|
|
*/
|
|
exportKey(alg: Algorithm): PromiseType;
|
|
/**
|
|
* Returns the XML representation of the RSA key clause.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Loads an RSA key clause from an XML element.
|
|
* @param {Element} element
|
|
* @returns void
|
|
*/
|
|
LoadXml(element: Element): void;
|
|
}
|
|
|
|
type NamedCurve = "P-256" | "P-384" | "P-521";
|
|
|
|
interface IJwkEcdsa {
|
|
crv: NamedCurve;
|
|
kty: "EC";
|
|
x: string;
|
|
y: string;
|
|
ext: boolean;
|
|
}
|
|
|
|
/**
|
|
* Represents the <ECKeyValue> element of an XML signature.
|
|
*/
|
|
class EcdsaKeyValue extends XmlObject implements KeyInfoClause {
|
|
/**
|
|
* Gets or sets the instance of ECDSA that holds the public key.
|
|
*/
|
|
Key: CryptoKey;
|
|
/**
|
|
* Gets the algorithm of the public key
|
|
*/
|
|
Algorithm: ISignatureAlgorithm;
|
|
/**
|
|
* Gets the X point value of then public key
|
|
*/
|
|
X: Uint8Array;
|
|
/**
|
|
* Gets the Y point value of then public key
|
|
*/
|
|
Y: Uint8Array;
|
|
/**
|
|
* Gets the NamedCurve value of then public key
|
|
*/
|
|
NamedCurve: NamedCurve;
|
|
constructor();
|
|
/**
|
|
* Imports key to the ECKeyValue object
|
|
* @param {CryptoKey} key
|
|
* @returns PromiseType
|
|
*/
|
|
importKey(key: CryptoKey): PromiseType;
|
|
/**
|
|
* Exports key from the ECKeyValue object
|
|
* @param {Algorithm} alg
|
|
* @returns PromiseType
|
|
*/
|
|
exportKey(alg: Algorithm): PromiseType;
|
|
/**
|
|
* Returns the XML representation of the ECDSA key clause.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Loads an ECDSA key clause from an XML element.
|
|
* @param {Element} element
|
|
* @returns void
|
|
*/
|
|
LoadXml(element: Element): void;
|
|
}
|
|
|
|
type XmlNamespace = {
|
|
prefix: string;
|
|
namespace: string;
|
|
};
|
|
|
|
enum XmlCanonicalizerState {
|
|
BeforeDocElement = 0,
|
|
InsideDocElement = 1,
|
|
AfterDocElement = 2,
|
|
}
|
|
|
|
class XmlCanonicalizer {
|
|
constructor(withComments: boolean, excC14N: boolean, propagatedNamespaces?: XmlNamespace[]);
|
|
InclusiveNamespacesPrefixList: string;
|
|
Canonicalize(node: Node): string;
|
|
}
|
|
|
|
interface Transform extends IXmlSerializable {
|
|
Algorithm: string;
|
|
LoadInnerXml(node: Node): void;
|
|
GetInnerXml(): Node;
|
|
GetOutput(): string;
|
|
}
|
|
|
|
interface ICanonicalizationAlgorithmConstructable {
|
|
new (): Transform;
|
|
}
|
|
/**
|
|
* Represents the abstract base class from which all <Transform> elements
|
|
* that can be used in an XML digital signature derive.
|
|
*/
|
|
abstract class Transform extends XmlObject implements Transform {
|
|
protected innerXml: Node;
|
|
LoadXml(value: Node): void;
|
|
/**
|
|
* Returns the XML representation of the current Transform object.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
}
|
|
|
|
/**
|
|
* Represents the enveloped signature transform for an XML digital signature as defined by the W3C.
|
|
*/
|
|
class XmlDsigEnvelopedSignatureTransform extends Transform {
|
|
Algorithm: string;
|
|
/**
|
|
* Returns the output of the current XmlDsigEnvelopedSignatureTransform object.
|
|
* @returns string
|
|
*/
|
|
GetOutput(): string;
|
|
}
|
|
|
|
/**
|
|
* Represents the C14N XML canonicalization transform for a digital signature
|
|
* as defined by the World Wide Web Consortium (W3C), without comments.
|
|
*/
|
|
class XmlDsigC14NTransform extends Transform {
|
|
protected xmlCanonicalizer: XmlCanonicalizer;
|
|
Algorithm: string;
|
|
/**
|
|
* Returns the output of the current XmlDsigC14NTransform object.
|
|
* @returns string
|
|
*/
|
|
GetOutput(): string;
|
|
}
|
|
/**
|
|
* Represents the C14N XML canonicalization transform for a digital signature
|
|
* as defined by the World Wide Web Consortium (W3C), with comments.
|
|
*/
|
|
class XmlDsigC14NWithCommentsTransform extends XmlDsigC14NTransform {
|
|
Algorithm: string;
|
|
protected xmlCanonicalizer: XmlCanonicalizer;
|
|
}
|
|
|
|
/**
|
|
* Represents the exclusive C14N XML canonicalization transform for a digital signature
|
|
* as defined by the World Wide Web Consortium (W3C), without comments.
|
|
*/
|
|
class XmlDsigExcC14NTransform extends Transform {
|
|
protected xmlCanonicalizer: XmlCanonicalizer;
|
|
Algorithm: string;
|
|
/**
|
|
* Gets or sets a string that contains namespace prefixes to canonicalize
|
|
* using the standard canonicalization algorithm.
|
|
*/
|
|
InclusiveNamespacesPrefixList: string;
|
|
/**
|
|
* Returns the output of the current XmlDsigExcC14NTransform object
|
|
*/
|
|
GetOutput(): string;
|
|
}
|
|
/**
|
|
* Represents the exclusive C14N XML canonicalization transform for a digital signature
|
|
* as defined by the World Wide Web Consortium (W3C), with comments.
|
|
*/
|
|
class XmlDsigExcC14NWithCommentsTransform extends XmlDsigExcC14NTransform {
|
|
Algorithm: string;
|
|
protected xmlCanonicalizer: XmlCanonicalizer;
|
|
}
|
|
|
|
class CryptoConfig {
|
|
static CreateFromName(name: string): Transform;
|
|
static CreateSignatureAlgorithm(namespace: string): SignatureAlgorithm;
|
|
static CreateHashAlgorithm(namespace: string): HashAlgorithm;
|
|
}
|
|
|
|
/**
|
|
* Represents the object element of an XML signature that holds data to be signed.
|
|
*/
|
|
class DataObject extends XmlObject {
|
|
constructor();
|
|
constructor(id?: string, mimeType?: string, encoding?: string, data?: Element);
|
|
/**
|
|
* Gets or sets the data value of the current DataObject object.
|
|
*/
|
|
Data: NodeList;
|
|
/**
|
|
* Gets or sets the encoding of the current DataObject object.
|
|
*/
|
|
Encoding: string;
|
|
/**
|
|
* Gets or sets the identification of the current DataObject object.
|
|
*/
|
|
Id: string;
|
|
/**
|
|
* Gets or sets the MIME type of the current DataObject object.
|
|
*/
|
|
MimeType: string;
|
|
/**
|
|
* Returns the XML representation of the DataObject object.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Loads a DataObject state from an XML element.
|
|
* @param {Element} value
|
|
* @returns void
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
}
|
|
|
|
/**
|
|
* Represents the <reference> element of an XML signature.
|
|
*/
|
|
class Reference extends XmlObject {
|
|
|
|
constructor(p?: string);
|
|
/**
|
|
* Gets or sets the digest method Uniform Resource Identifier (URI) of the current
|
|
*/
|
|
DigestMethod: string;
|
|
/**
|
|
* Gets or sets the digest value of the current Reference.
|
|
*/
|
|
DigestValue: ArrayBuffer;
|
|
/**
|
|
* Gets or sets the ID of the current Reference.
|
|
*/
|
|
Id: string;
|
|
/**
|
|
* Gets the transform chain of the current Reference.
|
|
*/
|
|
TransformChain: Transform[];
|
|
/**
|
|
* Gets or sets the type of the object being signed.
|
|
*/
|
|
Type: string;
|
|
/**
|
|
* Gets or sets the Uri of the current Reference.
|
|
*/
|
|
Uri: string;
|
|
/**
|
|
* Adds a Transform object to the list of transforms to be performed
|
|
* on the data before passing it to the digest algorithm.
|
|
* @param {Transform} transform The transform to be added to the list of transforms.
|
|
* @returns void
|
|
*/
|
|
AddTransform(transform: Transform): void;
|
|
/**
|
|
* Returns the XML representation of the Reference.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Loads a Reference state from an XML element.
|
|
* @param {Element} value
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
}
|
|
|
|
/**
|
|
* Represents an XML digital signature or XML encryption <KeyInfo> element.
|
|
*/
|
|
class KeyInfo extends XmlObject {
|
|
constructor();
|
|
/**
|
|
* Gets the number of KeyInfoClause objects contained in the KeyInfo object.
|
|
*/
|
|
length: number;
|
|
/**
|
|
* Gets or sets the key information identity.
|
|
*/
|
|
Id: string;
|
|
/**
|
|
* Returns an enumerator of the KeyInfoClause objects in the KeyInfo object.
|
|
* @param {any} requestedObjectType?
|
|
*/
|
|
GetEnumerator(): Array<KeyInfoClause>;
|
|
GetEnumerator(requestedObjectType: any): Array<KeyInfoClause>;
|
|
/**
|
|
* Returns an enumerator of the KeyInfoClause objects in the KeyInfo object.
|
|
* @param {KeyInfoClause} clause The KeyInfoClause to add to the KeyInfo object.
|
|
* @returns void
|
|
*/
|
|
AddClause(clause: KeyInfoClause): void;
|
|
/**
|
|
* Returns the XML representation of the KeyInfo object.
|
|
* @returns Node
|
|
*/
|
|
GetXml(): Node;
|
|
/**
|
|
* Loads a KeyInfo state from an XML element.
|
|
* @param {Element} value
|
|
* @returns void
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
}
|
|
interface KeyInfoClause extends IXmlSerializable {
|
|
Key: CryptoKey;
|
|
importKey(key: CryptoKey): PromiseType;
|
|
exportKey(alg: Algorithm): PromiseType;
|
|
}
|
|
|
|
/**
|
|
* Represents the <Signature> element of an XML signature.
|
|
*/
|
|
class Signature extends XmlObject {
|
|
|
|
constructor();
|
|
/**
|
|
* Gets or sets the ID of the current Signature.
|
|
*/
|
|
Id: string;
|
|
/**
|
|
* Gets or sets the KeyInfo of the current Signature.
|
|
*/
|
|
KeyInfo: KeyInfo;
|
|
/**
|
|
* Gets or sets a list of objects to be signed.
|
|
*/
|
|
ObjectList: Array<DataObject>;
|
|
/**
|
|
* Gets or sets the value of the digital signature.
|
|
*/
|
|
SignatureValue: Uint8Array;
|
|
/**
|
|
* Gets or sets the SignedInfo of the current Signature.
|
|
*/
|
|
SignedInfo: SignedInfo;
|
|
/**
|
|
* Adds a DataObject to the list of objects to be signed.
|
|
* @param {DataObject} dataObject The DataObject to be added to the list of objects to be signed.
|
|
* @returns void
|
|
*/
|
|
AddObject(dataObject: DataObject): void;
|
|
/**
|
|
* Returns the XML representation of the Signature.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
/**
|
|
* Loads a Signature state from an XML element.
|
|
* @param {Element} value
|
|
* @returns void
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
}
|
|
const XmlSignature: {
|
|
ElementNames: {
|
|
CanonicalizationMethod: string;
|
|
DigestMethod: string;
|
|
DigestValue: string;
|
|
DSAKeyValue: string;
|
|
EncryptedKey: string;
|
|
HMACOutputLength: string;
|
|
RSAPSSParams: string;
|
|
MaskGenerationFunction: string;
|
|
SaltLength: string;
|
|
KeyInfo: string;
|
|
KeyName: string;
|
|
KeyValue: string;
|
|
Modulus: string;
|
|
Exponent: string;
|
|
Manifest: string;
|
|
Object: string;
|
|
Reference: string;
|
|
RetrievalMethod: string;
|
|
RSAKeyValue: string;
|
|
ECKeyValue: string;
|
|
NamedCurve: string;
|
|
PublicKey: string;
|
|
Signature: string;
|
|
SignatureMethod: string;
|
|
SignatureValue: string;
|
|
SignedInfo: string;
|
|
Transform: string;
|
|
Transforms: string;
|
|
X509Data: string;
|
|
X509IssuerSerial: string;
|
|
X509IssuerName: string;
|
|
X509SerialNumber: string;
|
|
X509SKI: string;
|
|
X509SubjectName: string;
|
|
X509Certificate: string;
|
|
X509CRL: string;
|
|
};
|
|
AttributeNames: {
|
|
Algorithm: string;
|
|
Encoding: string;
|
|
Id: string;
|
|
MimeType: string;
|
|
Type: string;
|
|
URI: string;
|
|
};
|
|
AlgorithmNamespaces: {
|
|
XmlDsigBase64Transform: string;
|
|
XmlDsigC14NTransform: string;
|
|
XmlDsigC14NWithCommentsTransform: string;
|
|
XmlDsigEnvelopedSignatureTransform: string;
|
|
XmlDsigXPathTransform: string;
|
|
XmlDsigXsltTransform: string;
|
|
XmlDsigExcC14NTransform: string;
|
|
XmlDsigExcC14NWithCommentsTransform: string;
|
|
XmlDecryptionTransform: string;
|
|
XmlLicenseTransform: string;
|
|
};
|
|
Uri: {
|
|
Manifest: string;
|
|
};
|
|
NamespaceURI: string;
|
|
NamespaceURIMore: string;
|
|
NamespaceURIPss: string;
|
|
Prefix: string;
|
|
GetChildElement: (xel: Node, element: string, ns: string) => Element;
|
|
GetAttributeFromElement: (xel: Element, attribute: string, element: string) => string;
|
|
GetChildElements: (xel: Element, element: string) => Element[];
|
|
};
|
|
|
|
/**
|
|
* The SignedInfo class represents the <SignedInfo> element
|
|
* of an XML signature defined by the XML digital signature specification
|
|
*/
|
|
class SignedInfo extends XmlObject {
|
|
|
|
constructor(signedXml?: SignedXml);
|
|
/**
|
|
* Gets or sets the canonicalization algorithm that is used before signing
|
|
* for the current SignedInfo object.
|
|
*/
|
|
CanonicalizationMethod: string;
|
|
/**
|
|
* Gets a Transform object used for canonicalization.
|
|
* @returns Transform
|
|
*/
|
|
CanonicalizationMethodObject: Transform;
|
|
/**
|
|
* Gets the number of references in the current SignedInfo object.
|
|
*/
|
|
Count: number;
|
|
/**
|
|
* Gets or sets the ID of the current SignedInfo object.
|
|
*/
|
|
Id: string;
|
|
/**
|
|
* Gets a value that indicates whether the collection is read-only.
|
|
* @returns boolean
|
|
*/
|
|
IsReadOnly: boolean;
|
|
/**
|
|
* Gets a value that indicates whether the collection is synchronized.
|
|
* @returns boolean
|
|
*/
|
|
IsSynchronized: boolean;
|
|
/**
|
|
* Gets a list of the Reference objects of the current SignedInfo object.
|
|
*/
|
|
References: Reference[];
|
|
/**
|
|
* Gets or sets the length of the signature for the current SignedInfo object.
|
|
*/
|
|
SignatureLength: string;
|
|
/**
|
|
* Gets or sets the name of the algorithm used for signature generation
|
|
* and validation for the current SignedInfo object.
|
|
*/
|
|
SignatureMethod: string;
|
|
SignatureParams: XmlObject;
|
|
/**
|
|
* Gets an object to use for synchronization.
|
|
*/
|
|
SyncRoot: any;
|
|
/**
|
|
* Adds a Reference object to the list of references to digest and sign.
|
|
* @param {Reference} reference The reference to add to the list of references.
|
|
* @returns void
|
|
*/
|
|
AddReference(reference: Reference): void;
|
|
/**
|
|
* Copies the elements of this instance into an Array object, starting at a specified index in the array.
|
|
* @param {any[]} array
|
|
* @param {number} index
|
|
* @returns void
|
|
*/
|
|
CopyTo(array: any[], index: number): void;
|
|
/**
|
|
* Returns the XML representation of the SignedInfo object.
|
|
* @returns Node
|
|
*/
|
|
GetXml(): Node;
|
|
/**
|
|
* Loads a SignedInfo state from an XML element.
|
|
* @param {Element} value
|
|
* @returns void
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
}
|
|
|
|
/**
|
|
* Provides a wrapper on a core XML signature object to facilitate creating XML signatures.
|
|
*/
|
|
class SignedXml extends XmlObject {
|
|
/**
|
|
* Gets or sets the KeyInfo object of the current SignedXml object.
|
|
*/
|
|
KeyInfo: KeyInfo;
|
|
/**
|
|
* Gets the Signature object of the current SignedXml object.
|
|
*/
|
|
Signature: Signature;
|
|
/**
|
|
* Gets or sets the prefix for the current SignedXml object.
|
|
*/
|
|
Prefix: string;
|
|
/**
|
|
* Gets the length of the signature for the current SignedXml object.
|
|
*/
|
|
SignatureLength: number;
|
|
SignatureMethod: string;
|
|
/**
|
|
* Gets the signature value of the current SignedXml object.
|
|
*/
|
|
SignatureValue: ArrayBuffer;
|
|
/**
|
|
* Gets the CanonicalizationMethod of the current SignedXml object.
|
|
*/
|
|
CanonicalizationMethod: string;
|
|
/**
|
|
* Gets the SignedInfo object of the current SignedXml object.
|
|
*/
|
|
SignedInfo: SignedInfo;
|
|
/**
|
|
* Gets or sets the asymmetric algorithm key used for signing a SignedXml object.
|
|
*/
|
|
SigningKey: CryptoKey;
|
|
/**
|
|
* Gets or sets the name of the installed key to be used for signing the SignedXml object.
|
|
*/
|
|
SigningKeyName: string;
|
|
/**
|
|
* @param {string} idMode. Value of "wssecurity" will create/validate id's with the ws-security namespace
|
|
*/
|
|
constructor();
|
|
constructor(node: Document);
|
|
constructor(node: Element);
|
|
/**
|
|
* Adds a Reference object to the SignedXml object that describes a digest method,
|
|
* digest value, and transform to use for creating an XML digital signature.
|
|
* @param {Reference} reference The Reference object that describes a digest method, digest value,
|
|
* and transform to use for creating an XML digital signature.
|
|
* @returns void
|
|
*/
|
|
AddReference(reference: Reference): void;
|
|
/**
|
|
* Computes an XML digital signature using the specified algorithm.
|
|
* @param {Algorithm} algorithm Specified WebCrypto Algoriithm
|
|
* @returns PromiseType
|
|
*/
|
|
ComputeSignature(algorithm: Algorithm): PromiseType;
|
|
/**
|
|
* Determines whether the SignedXml.Signature property verifies using the public key in the signature.
|
|
* @returns PromiseType
|
|
*/
|
|
CheckSignature(): PromiseType;
|
|
CheckSignature(key: CryptoKey): PromiseType;
|
|
CheckSignature(cert: X509Certificate): PromiseType;
|
|
/**
|
|
* Loads a SignedXml state from an XML element.
|
|
* @param {Element} value The XML element to load the SignedXml state from.
|
|
* @returns void
|
|
*/
|
|
LoadXml(value: Element): void;
|
|
/**
|
|
* Returns the XML representation of a SignedXml object.
|
|
* @returns Element
|
|
*/
|
|
GetXml(): Element;
|
|
}
|
|
}
|