UNPKG

@wildboar/pkcs

Version:
44 lines 1.42 kB
import { ASN1Element as _Element } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { DataObject } from "../PKCS-15/DataObject.ta.mjs"; import { ExternalIDO } from "../PKCS-15/ExternalIDO.ta.mjs"; import { OidDO } from "../PKCS-15/OidDO.ta.mjs"; import { Opaque } from "../PKCS-15/Opaque.ta.mjs"; /** * @summary DataType * @description * * ### ASN.1 Definition: * * ```asn1 * DataType ::= CHOICE { * opaqueDO DataObject {Opaque}, * externalIDO [0] DataObject {ExternalIDO}, * oidDO [1] DataObject {OidDO}, * ... -- For future extensions * } * ``` */ export type DataType = { opaqueDO: DataObject<Opaque>; } | { externalIDO: DataObject<ExternalIDO>; } | { oidDO: DataObject<OidDO>; } | _Element; /** * @summary Decodes an ASN.1 element into a(n) DataType * @function * @param {_Element} el The element being decoded. * @returns {DataType} The decoded data structure. */ export declare function _decode_DataType(el: _Element): DataType; /** * @summary Encodes a(n) DataType 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 DataType, encoded as an ASN.1 Element. */ export declare function _encode_DataType(value: DataType, elGetter: $.ASN1Encoder<DataType>): _Element; //# sourceMappingURL=DataType.ta.d.mts.map