@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
251 lines • 6.67 kB
text/typescript
import { ASN1Element as _Element, OCTET_STRING, OPTIONAL, PrintableString } from "@wildboar/asn1";
import * as $ from "@wildboar/asn1/functional";
import { AlgorithmInfo } from "../PKCS-15/AlgorithmInfo.ta.mjs";
import { Label } from "../PKCS-15/Label.ta.mjs";
import { LastUpdate } from "../PKCS-15/LastUpdate.ta.mjs";
import { RecordInfo } from "../PKCS-15/RecordInfo.ta.mjs";
import { SecurityEnvironmentInfo } from "../PKCS-15/SecurityEnvironmentInfo.ta.mjs";
import { TokenFlags } from "../PKCS-15/TokenFlags.ta.mjs";
import { TokenInfo_version } from "../PKCS-15/TokenInfo-version.ta.mjs";
/**
* @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 -- })
* ```
*
*/
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 The element being encoded.
* @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;
//# sourceMappingURL=TokenInfo.ta.d.mts.map