UNPKG

@wildboar/pkcs

Version:
195 lines (194 loc) 6.16 kB
import { ASN1Element as _Element, BOOLEAN, GeneralizedTime, OPTIONAL } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { Identifier } from "../PKCS-15/Identifier.ta"; import { KeyAccessFlags } from "../PKCS-15/KeyAccessFlags.ta"; import { KeyUsageFlags } from "../PKCS-15/KeyUsageFlags.ta"; import { Reference } from "../PKCS-15/Reference.ta"; export { Identifier, _decode_Identifier, _encode_Identifier, } from "../PKCS-15/Identifier.ta"; export { alwaysSensitive, extractable, KeyAccessFlags, KeyAccessFlags_alwaysSensitive, KeyAccessFlags_extractable, KeyAccessFlags_local, KeyAccessFlags_neverExtractable, KeyAccessFlags_sensitive, local, neverExtractable, sensitive, _decode_KeyAccessFlags, _encode_KeyAccessFlags, } from "../PKCS-15/KeyAccessFlags.ta"; export { decrypt, derive, encrypt, KeyUsageFlags, KeyUsageFlags_decrypt, KeyUsageFlags_derive, KeyUsageFlags_encrypt, KeyUsageFlags_nonRepudiation, KeyUsageFlags_sign, KeyUsageFlags_signRecover, KeyUsageFlags_unwrap, KeyUsageFlags_verify, KeyUsageFlags_verifyRecover, KeyUsageFlags_wrap, nonRepudiation, sign, signRecover, unwrap, verify, verifyRecover, wrap, _decode_KeyUsageFlags, _encode_KeyUsageFlags, } from "../PKCS-15/KeyUsageFlags.ta"; export { Reference, _decode_Reference, _encode_Reference, } from "../PKCS-15/Reference.ta"; /** * @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 * } * ``` * * @class */ 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} el The element being decoded. * @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;