UNPKG

@wildboar/pkcs

Version:
124 lines 3.4 kB
import { ASN1Element as _Element, INTEGER, OCTET_STRING, OPTIONAL } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { DigestInfo } from "../PKCS7/DigestInfo.ta.mjs"; /** * @summary MacData * @description * * ### ASN.1 Definition: * * ```asn1 * MacData ::= SEQUENCE { * mac DigestInfo, * macSalt OCTET STRING, * iterations INTEGER DEFAULT 1 * -- Note: The default is for historical reasons and its use is * -- deprecated. * } * ``` * */ export declare class MacData { /** * @summary `mac`. * @public * @readonly */ readonly mac: DigestInfo; /** * @summary `macSalt`. * @public * @readonly */ readonly macSalt: OCTET_STRING; /** * @summary `iterations`. * @public * @readonly */ readonly iterations?: OPTIONAL<INTEGER>; constructor( /** * @summary `mac`. * @public * @readonly */ mac: DigestInfo, /** * @summary `macSalt`. * @public * @readonly */ macSalt: OCTET_STRING, /** * @summary `iterations`. * @public * @readonly */ iterations?: OPTIONAL<INTEGER>); /** * @summary Restructures an object into a MacData * @description * * This takes an `object` and converts it to a `MacData`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `MacData`. * @returns {MacData} */ static _from_object(_o: { [_K in keyof MacData]: MacData[_K]; }): MacData; /** * @summary Getter that returns the default value for `iterations`. * @public * @static * @method */ static get _default_value_for_iterations(): INTEGER; } /** * @summary The Leading Root Component Types of MacData * @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_MacData: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of MacData * @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_MacData: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of MacData * @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_MacData: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) MacData * @function * @param {_Element} el The element being decoded. * @returns {MacData} The decoded data structure. */ export declare function _decode_MacData(el: _Element): MacData; /** * @summary Encodes a(n) MacData into an ASN.1 Element. * @function * @param value The element being encoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The MacData, encoded as an ASN.1 Element. */ export declare function _encode_MacData(value: MacData, elGetter: $.ASN1Encoder<MacData>): _Element; //# sourceMappingURL=MacData.ta.d.mts.map