UNPKG

@wildboar/pkcs

Version:
145 lines (144 loc) 4.51 kB
import { ASN1Element as _Element, OPTIONAL } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { Certificate } from "@wildboar/x500/src/lib/modules/AuthenticationFramework/Certificate.ta"; import { CertificateSerialNumber } from "@wildboar/x500/src/lib/modules/AuthenticationFramework/CertificateSerialNumber.ta"; import { Name } from "@wildboar/x500/src/lib/modules/InformationFramework/Name.ta"; import { ObjectValue } from "../PKCS-15/ObjectValue.ta"; /** * @summary X509CertificateAttributes * @description * * ### ASN.1 Definition: * * ```asn1 * X509CertificateAttributes ::= SEQUENCE { * value ObjectValue { Certificate }, * subject Name OPTIONAL, * issuer [0] Name OPTIONAL, * serialNumber CertificateSerialNumber OPTIONAL, * ... -- For future extensions * } * ``` * * @class */ export declare class X509CertificateAttributes { /** * @summary `value`. * @public * @readonly */ readonly value: ObjectValue<Certificate>; /** * @summary `subject`. * @public * @readonly */ readonly subject: OPTIONAL<Name>; /** * @summary `issuer`. * @public * @readonly */ readonly issuer: OPTIONAL<Name>; /** * @summary `serialNumber`. * @public * @readonly */ readonly serialNumber: OPTIONAL<CertificateSerialNumber>; /** * @summary Extensions that are not recognized. * @public * @readonly */ readonly _unrecognizedExtensionsList: _Element[]; constructor( /** * @summary `value`. * @public * @readonly */ value: ObjectValue<Certificate>, /** * @summary `subject`. * @public * @readonly */ subject: OPTIONAL<Name>, /** * @summary `issuer`. * @public * @readonly */ issuer: OPTIONAL<Name>, /** * @summary `serialNumber`. * @public * @readonly */ serialNumber: OPTIONAL<CertificateSerialNumber>, /** * @summary Extensions that are not recognized. * @public * @readonly */ _unrecognizedExtensionsList?: _Element[]); /** * @summary Restructures an object into a X509CertificateAttributes * @description * * This takes an `object` and converts it to a `X509CertificateAttributes`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `X509CertificateAttributes`. * @returns {X509CertificateAttributes} */ static _from_object(_o: { [_K in keyof X509CertificateAttributes]: X509CertificateAttributes[_K]; }): X509CertificateAttributes; } /** * @summary The Leading Root Component Types of X509CertificateAttributes * @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_X509CertificateAttributes: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of X509CertificateAttributes * @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_X509CertificateAttributes: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of X509CertificateAttributes * @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_X509CertificateAttributes: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) X509CertificateAttributes * @function * @param {_Element} el The element being decoded. * @returns {X509CertificateAttributes} The decoded data structure. */ export declare function _decode_X509CertificateAttributes(el: _Element): X509CertificateAttributes; /** * @summary Encodes a(n) X509CertificateAttributes 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 X509CertificateAttributes, encoded as an ASN.1 Element. */ export declare function _encode_X509CertificateAttributes(value: X509CertificateAttributes, elGetter: $.ASN1Encoder<X509CertificateAttributes>): _Element;