UNPKG

@wildboar/pkcs

Version:
190 lines 5.28 kB
import { ASN1Element as _Element, BOOLEAN, GeneralizedTime, OPTIONAL } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { Identifier } from "../PKCS-15/Identifier.ta.mjs"; import { KeyAccessFlags } from "../PKCS-15/KeyAccessFlags.ta.mjs"; import { KeyUsageFlags } from "../PKCS-15/KeyUsageFlags.ta.mjs"; import { Reference } from "../PKCS-15/Reference.ta.mjs"; /** * @summary CommonKeyAttributes * @description * * ### ASN.1 Definition: * * ```asn1 * CommonKeyAttributes ::= SEQUENCE { * iD Identifier, * usage KeyUsageFlags, * native BOOLEAN DEFAULT TRUE, * accessFlags KeyAccessFlags OPTIONAL, * keyReference Reference OPTIONAL, * startDate GeneralizedTime OPTIONAL, * endDate [0] GeneralizedTime OPTIONAL, * ... -- For future extensions * } * ``` * */ export declare class CommonKeyAttributes { /** * @summary `iD`. * @public * @readonly */ readonly iD: Identifier; /** * @summary `usage`. * @public * @readonly */ readonly usage: KeyUsageFlags; /** * @summary `native`. * @public * @readonly */ readonly native?: OPTIONAL<BOOLEAN>; /** * @summary `accessFlags`. * @public * @readonly */ readonly accessFlags?: OPTIONAL<KeyAccessFlags>; /** * @summary `keyReference`. * @public * @readonly */ readonly keyReference?: OPTIONAL<Reference>; /** * @summary `startDate`. * @public * @readonly */ readonly startDate?: OPTIONAL<GeneralizedTime>; /** * @summary `endDate`. * @public * @readonly */ readonly endDate?: OPTIONAL<GeneralizedTime>; /** * @summary Extensions that are not recognized. * @public * @readonly */ readonly _unrecognizedExtensionsList: _Element[]; constructor( /** * @summary `iD`. * @public * @readonly */ iD: Identifier, /** * @summary `usage`. * @public * @readonly */ usage: KeyUsageFlags, /** * @summary `native`. * @public * @readonly */ native?: OPTIONAL<BOOLEAN>, /** * @summary `accessFlags`. * @public * @readonly */ accessFlags?: OPTIONAL<KeyAccessFlags>, /** * @summary `keyReference`. * @public * @readonly */ keyReference?: OPTIONAL<Reference>, /** * @summary `startDate`. * @public * @readonly */ startDate?: OPTIONAL<GeneralizedTime>, /** * @summary `endDate`. * @public * @readonly */ endDate?: OPTIONAL<GeneralizedTime>, /** * @summary Extensions that are not recognized. * @public * @readonly */ _unrecognizedExtensionsList?: _Element[]); /** * @summary Restructures an object into a CommonKeyAttributes * @description * * This takes an `object` and converts it to a `CommonKeyAttributes`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `CommonKeyAttributes`. * @returns {CommonKeyAttributes} */ static _from_object(_o: { [_K in keyof CommonKeyAttributes]: CommonKeyAttributes[_K]; }): CommonKeyAttributes; /** * @summary Getter that returns the default value for `native`. * @public * @static * @method */ static get _default_value_for_native(): boolean; } /** * @summary The Leading Root Component Types of CommonKeyAttributes * @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_CommonKeyAttributes: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of CommonKeyAttributes * @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_CommonKeyAttributes: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of CommonKeyAttributes * @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_CommonKeyAttributes: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) CommonKeyAttributes * @function * @param {_Element} el The element being decoded. * @returns {CommonKeyAttributes} The decoded data structure. */ export declare function _decode_CommonKeyAttributes(el: _Element): CommonKeyAttributes; /** * @summary Encodes a(n) CommonKeyAttributes 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 CommonKeyAttributes, encoded as an ASN.1 Element. */ export declare function _encode_CommonKeyAttributes(value: CommonKeyAttributes, elGetter: $.ASN1Encoder<CommonKeyAttributes>): _Element; //# sourceMappingURL=CommonKeyAttributes.ta.d.mts.map