UNPKG

@wildboar/pkcs

Version:
259 lines (258 loc) 7.52 kB
import { ASN1Element as _Element, OCTET_STRING, OPTIONAL, PrintableString } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { AlgorithmInfo } from "../PKCS-15/AlgorithmInfo.ta"; import { Label } from "../PKCS-15/Label.ta"; import { LastUpdate } from "../PKCS-15/LastUpdate.ta"; import { RecordInfo } from "../PKCS-15/RecordInfo.ta"; import { SecurityEnvironmentInfo } from "../PKCS-15/SecurityEnvironmentInfo.ta"; import { TokenFlags } from "../PKCS-15/TokenFlags.ta"; import { TokenInfo_version } from "../PKCS-15/TokenInfo-version.ta"; export { AlgorithmInfo, _decode_AlgorithmInfo, _encode_AlgorithmInfo, } from "../PKCS-15/AlgorithmInfo.ta"; export { Label, _decode_Label, _encode_Label } from "../PKCS-15/Label.ta"; export { LastUpdate, _decode_LastUpdate, _encode_LastUpdate, } from "../PKCS-15/LastUpdate.ta"; export { RecordInfo, _decode_RecordInfo, _encode_RecordInfo, } from "../PKCS-15/RecordInfo.ta"; export { SecurityEnvironmentInfo, _decode_SecurityEnvironmentInfo, _encode_SecurityEnvironmentInfo, } from "../PKCS-15/SecurityEnvironmentInfo.ta"; export { eidCompliant, loginRequired, prnGeneration, readonly, TokenFlags, TokenFlags_eidCompliant, TokenFlags_loginRequired, TokenFlags_prnGeneration, TokenFlags_readonly, _decode_TokenFlags, _encode_TokenFlags, } from "../PKCS-15/TokenFlags.ta"; export { TokenInfo_version, TokenInfo_version_v1, v1, _decode_TokenInfo_version, _encode_TokenInfo_version, } from "../PKCS-15/TokenInfo-version.ta"; /** * @summary TokenInfo * @description * * ### ASN.1 Definition: * * ```asn1 * TokenInfo ::= SEQUENCE { * version INTEGER {v1(0)} (v1,...), * serialNumber OCTET STRING, * manufacturerID Label OPTIONAL, * label [0] Label OPTIONAL, * tokenflags TokenFlags, * seInfo SEQUENCE OF SecurityEnvironmentInfo OPTIONAL, * recordInfo [1] RecordInfo OPTIONAL, * supportedAlgorithms [2] SEQUENCE OF AlgorithmInfo OPTIONAL, * ..., * issuerId [3] Label OPTIONAL, * holderId [4] Label OPTIONAL, * lastUpdate [5] LastUpdate OPTIONAL, * preferredLanguage PrintableString OPTIONAL -- In accordance with IETF RFC 1766 * } (CONSTRAINED BY { -- Each AlgorithmInfo.reference value must be unique -- }) * ``` * * @class */ export declare class TokenInfo { /** * @summary `version`. * @public * @readonly */ readonly version: TokenInfo_version; /** * @summary `serialNumber`. * @public * @readonly */ readonly serialNumber: OCTET_STRING; /** * @summary `manufacturerID`. * @public * @readonly */ readonly manufacturerID: OPTIONAL<Label>; /** * @summary `label`. * @public * @readonly */ readonly label: OPTIONAL<Label>; /** * @summary `tokenflags`. * @public * @readonly */ readonly tokenflags: TokenFlags; /** * @summary `seInfo`. * @public * @readonly */ readonly seInfo: OPTIONAL<SecurityEnvironmentInfo[]>; /** * @summary `recordInfo`. * @public * @readonly */ readonly recordInfo: OPTIONAL<RecordInfo>; /** * @summary `supportedAlgorithms`. * @public * @readonly */ readonly supportedAlgorithms: OPTIONAL<AlgorithmInfo[]>; /** * @summary `issuerId`. * @public * @readonly */ readonly issuerId: OPTIONAL<Label>; /** * @summary `holderId`. * @public * @readonly */ readonly holderId: OPTIONAL<Label>; /** * @summary `lastUpdate`. * @public * @readonly */ readonly lastUpdate: OPTIONAL<LastUpdate>; /** * @summary `preferredLanguage`. * @public * @readonly */ readonly preferredLanguage: OPTIONAL<PrintableString>; /** * @summary Extensions that are not recognized. * @public * @readonly */ readonly _unrecognizedExtensionsList: _Element[]; constructor( /** * @summary `version`. * @public * @readonly */ version: TokenInfo_version, /** * @summary `serialNumber`. * @public * @readonly */ serialNumber: OCTET_STRING, /** * @summary `manufacturerID`. * @public * @readonly */ manufacturerID: OPTIONAL<Label>, /** * @summary `label`. * @public * @readonly */ label: OPTIONAL<Label>, /** * @summary `tokenflags`. * @public * @readonly */ tokenflags: TokenFlags, /** * @summary `seInfo`. * @public * @readonly */ seInfo: OPTIONAL<SecurityEnvironmentInfo[]>, /** * @summary `recordInfo`. * @public * @readonly */ recordInfo: OPTIONAL<RecordInfo>, /** * @summary `supportedAlgorithms`. * @public * @readonly */ supportedAlgorithms: OPTIONAL<AlgorithmInfo[]>, /** * @summary `issuerId`. * @public * @readonly */ issuerId: OPTIONAL<Label>, /** * @summary `holderId`. * @public * @readonly */ holderId: OPTIONAL<Label>, /** * @summary `lastUpdate`. * @public * @readonly */ lastUpdate: OPTIONAL<LastUpdate>, /** * @summary `preferredLanguage`. * @public * @readonly */ preferredLanguage: OPTIONAL<PrintableString>, /** * @summary Extensions that are not recognized. * @public * @readonly */ _unrecognizedExtensionsList?: _Element[]); /** * @summary Restructures an object into a TokenInfo * @description * * This takes an `object` and converts it to a `TokenInfo`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `TokenInfo`. * @returns {TokenInfo} */ static _from_object(_o: { [_K in keyof TokenInfo]: TokenInfo[_K]; }): TokenInfo; } /** * @summary The Leading Root Component Types of TokenInfo * @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_TokenInfo: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of TokenInfo * @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_TokenInfo: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of TokenInfo * @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_TokenInfo: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) TokenInfo * @function * @param {_Element} el The element being decoded. * @returns {TokenInfo} The decoded data structure. */ export declare function _decode_TokenInfo(el: _Element): TokenInfo; /** * @summary Encodes a(n) TokenInfo 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 TokenInfo, encoded as an ASN.1 Element. */ export declare function _encode_TokenInfo(value: TokenInfo, elGetter: $.ASN1Encoder<TokenInfo>): _Element;