@wildboar/pki-stub
Version:
X.510 PKI-Stub ASN.1 data structures in TypeScript
113 lines (112 loc) • 3.36 kB
TypeScript
import { BIT_STRING, ASN1Element as _Element } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { AlgorithmIdentifier } from "../PKI-Stub/AlgorithmIdentifier.ta";
/**
* @summary HASH
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* HASH{ToBeHashed} ::= SEQUENCE {
* algorithmIdentifier AlgorithmIdentifier{{SupportedAlgorithms}},
* hashValue BIT STRING,
* ... }
* ```
*
* @class
*/
export declare class HASH<ToBeHashed> {
/**
* @summary `algorithmIdentifier`.
* @public
* @readonly
*/
readonly algorithmIdentifier: AlgorithmIdentifier;
/**
* @summary `hashValue`.
* @public
* @readonly
*/
readonly hashValue: BIT_STRING;
/**
* @summary Extensions that are not recognized.
* @public
* @readonly
*/
readonly _unrecognizedExtensionsList: _Element[];
constructor(
/**
* @summary `algorithmIdentifier`.
* @public
* @readonly
*/
algorithmIdentifier: AlgorithmIdentifier,
/**
* @summary `hashValue`.
* @public
* @readonly
*/
hashValue: BIT_STRING,
/**
* @summary Extensions that are not recognized.
* @public
* @readonly
*/
_unrecognizedExtensionsList?: _Element[]);
/**
* @summary Restructures an object into a HASH
* @description
*
* This takes an `object` and converts it to a `HASH`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `HASH`.
* @returns {HASH}
*/
static _from_object(_o: {
[_K in keyof HASH<any>]: HASH<any>[_K];
}): HASH<any>;
}
/**
* @summary The Leading Root Component Types of HASH
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_1_spec_for_HASH: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of HASH
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_2_spec_for_HASH: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of HASH
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _extension_additions_list_spec_for_HASH: $.ComponentSpec[];
/**
* @summary Returns a function that will decode an ASN.1 element into a(n) HASH
* @function
* @param {_Element} el The element being decoded.
* @returns A function that will decode an ASN.1 element.
*/
export declare function _get_decoder_for_HASH<ToBeHashed>(_decode_ToBeHashed: $.ASN1Decoder<ToBeHashed>): <ToBeHashed_1>(el: _Element) => HASH<ToBeHashed_1>;
/**
* @summary Returns a function that will encode a(n) HASH into an ASN.1 Element.
* @function
* @returns A function that will encode a(n) HASH as an ASN.1 element.
*/
export declare function _get_encoder_for_HASH<ToBeHashed>(_encode_ToBeHashed: $.ASN1Encoder<ToBeHashed>): (value: HASH<ToBeHashed>, elGetter: $.ASN1Encoder<HASH<ToBeHashed>>) => _Element;