UNPKG

@wildboar/pki-stub

Version:
112 lines 3.33 kB
import { BIT_STRING, ASN1Element as _Element } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { AlgorithmIdentifier } from "../PKI-Stub/AlgorithmIdentifier.ta.mjs"; /** * @summary HASH * @description * * ### ASN.1 Definition: * * ```asn1 * HASH{ToBeHashed} ::= SEQUENCE { * algorithmIdentifier AlgorithmIdentifier{{SupportedAlgorithms}}, * hashValue BIT STRING, * ... } * ``` * */ 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>): $.ASN1Decoder<HASH<ToBeHashed>>; /** * @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>): $.ASN1Encoder<HASH<ToBeHashed>>; //# sourceMappingURL=HASH.ta.d.mts.map