UNPKG

@wildboar/pc

Version:

Trusted Computing Group Platform Certificate ASN.1 data structures in TypeScript

236 lines (235 loc) 8.12 kB
import { OPTIONAL, BOOLEAN, UTF8String, ASN1Element as _Element } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { ComponentClass } from "../PlatformCertificateProfile/ComponentClass.ta"; export { ComponentClass, _decode_ComponentClass, _encode_ComponentClass } from "../PlatformCertificateProfile/ComponentClass.ta"; import { PrivateEnterpriseNumber } from "../PlatformCertificateProfile/PrivateEnterpriseNumber.ta"; export { PrivateEnterpriseNumber, _decode_PrivateEnterpriseNumber, _encode_PrivateEnterpriseNumber } from "../PlatformCertificateProfile/PrivateEnterpriseNumber.ta"; import { ComponentAddress } from "../PlatformCertificateProfile/ComponentAddress.ta"; export { ComponentAddress, _decode_ComponentAddress, _encode_ComponentAddress } from "../PlatformCertificateProfile/ComponentAddress.ta"; import { CertificateIdentifier } from "../PlatformCertificateProfile/CertificateIdentifier.ta"; export { CertificateIdentifier, _decode_CertificateIdentifier, _encode_CertificateIdentifier } from "../PlatformCertificateProfile/CertificateIdentifier.ta"; import { URIReference } from "../PlatformCertificateProfile/URIReference.ta"; export { URIReference, _decode_URIReference, _encode_URIReference } from "../PlatformCertificateProfile/URIReference.ta"; import { AttributeStatus, _enum_for_AttributeStatus } from "../PlatformCertificateProfile/AttributeStatus.ta"; export { AttributeStatus, _enum_for_AttributeStatus, AttributeStatus_added, added, AttributeStatus_modified, modified, AttributeStatus_removed, removed, _decode_AttributeStatus, _encode_AttributeStatus } from "../PlatformCertificateProfile/AttributeStatus.ta"; /** * @summary ComponentIdentifier * @description * * ### ASN.1 Definition: * * ```asn1 * ComponentIdentifier ::= SEQUENCE { * componentClass ComponentClass, * componentManufacturer UTF8String (SIZE (1..strmax)), * componentModel UTF8String (SIZE (1..strmax)), * componentSerial [0] IMPLICIT UTF8String (SIZE (1..strmax)) OPTIONAL, * componentRevision [1] IMPLICIT UTF8String (SIZE (1..strmax)) OPTIONAL, * componentManufacturerId [2] IMPLICIT PrivateEnterpriseNumber OPTIONAL, * fieldReplaceable [3] IMPLICIT BOOLEAN OPTIONAL, * componentAddresses [4] IMPLICIT SEQUENCE (SIZE(1..MAX)) OF ComponentAddress OPTIONAL, * componentPlatformCert [5] IMPLICIT CertificateIdentifier OPTIONAL, * componentPlatformCertUri [6] IMPLICIT URIReference OPTIONAL, * status [7] IMPLICIT AttributeStatus OPTIONAL } * ``` * * @class */ export declare class ComponentIdentifier { /** * @summary `componentClass`. * @public * @readonly */ readonly componentClass: ComponentClass; /** * @summary `componentManufacturer`. * @public * @readonly */ readonly componentManufacturer: UTF8String; /** * @summary `componentModel`. * @public * @readonly */ readonly componentModel: UTF8String; /** * @summary `componentSerial`. * @public * @readonly */ readonly componentSerial: OPTIONAL<UTF8String>; /** * @summary `componentRevision`. * @public * @readonly */ readonly componentRevision: OPTIONAL<UTF8String>; /** * @summary `componentManufacturerId`. * @public * @readonly */ readonly componentManufacturerId: OPTIONAL<PrivateEnterpriseNumber>; /** * @summary `fieldReplaceable`. * @public * @readonly */ readonly fieldReplaceable: OPTIONAL<BOOLEAN>; /** * @summary `componentAddresses`. * @public * @readonly */ readonly componentAddresses: OPTIONAL<ComponentAddress[]>; /** * @summary `componentPlatformCert`. * @public * @readonly */ readonly componentPlatformCert: OPTIONAL<CertificateIdentifier>; /** * @summary `componentPlatformCertUri`. * @public * @readonly */ readonly componentPlatformCertUri: OPTIONAL<URIReference>; /** * @summary `status`. * @public * @readonly */ readonly status: OPTIONAL<AttributeStatus>; constructor( /** * @summary `componentClass`. * @public * @readonly */ componentClass: ComponentClass, /** * @summary `componentManufacturer`. * @public * @readonly */ componentManufacturer: UTF8String, /** * @summary `componentModel`. * @public * @readonly */ componentModel: UTF8String, /** * @summary `componentSerial`. * @public * @readonly */ componentSerial: OPTIONAL<UTF8String>, /** * @summary `componentRevision`. * @public * @readonly */ componentRevision: OPTIONAL<UTF8String>, /** * @summary `componentManufacturerId`. * @public * @readonly */ componentManufacturerId: OPTIONAL<PrivateEnterpriseNumber>, /** * @summary `fieldReplaceable`. * @public * @readonly */ fieldReplaceable: OPTIONAL<BOOLEAN>, /** * @summary `componentAddresses`. * @public * @readonly */ componentAddresses: OPTIONAL<ComponentAddress[]>, /** * @summary `componentPlatformCert`. * @public * @readonly */ componentPlatformCert: OPTIONAL<CertificateIdentifier>, /** * @summary `componentPlatformCertUri`. * @public * @readonly */ componentPlatformCertUri: OPTIONAL<URIReference>, /** * @summary `status`. * @public * @readonly */ status: OPTIONAL<AttributeStatus>); /** * @summary Restructures an object into a ComponentIdentifier * @description * * This takes an `object` and converts it to a `ComponentIdentifier`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `ComponentIdentifier`. * @returns {ComponentIdentifier} */ static _from_object(_o: { [_K in keyof (ComponentIdentifier)]: (ComponentIdentifier)[_K]; }): ComponentIdentifier; /** * @summary The enum used as the type of the component `status` * @public * @static */ static _enum_for_status: typeof _enum_for_AttributeStatus; } /** * @summary The Leading Root Component Types of ComponentIdentifier * @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_ComponentIdentifier: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of ComponentIdentifier * @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_ComponentIdentifier: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of ComponentIdentifier * @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_ComponentIdentifier: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) ComponentIdentifier * @function * @param {_Element} el The element being decoded. * @returns {ComponentIdentifier} The decoded data structure. */ export declare function _decode_ComponentIdentifier(el: _Element): ComponentIdentifier; /** * @summary Encodes a(n) ComponentIdentifier 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 ComponentIdentifier, encoded as an ASN.1 Element. */ export declare function _encode_ComponentIdentifier(value: ComponentIdentifier, elGetter: $.ASN1Encoder<ComponentIdentifier>): _Element;