UNPKG

@wildboar/pkcs

Version:
37 lines (36 loc) 1.31 kB
import * as $ from "asn1-ts/dist/node/functional"; import { Path } from "../PKCS-15/Path.ta"; import { URL } from "../PKCS-15/URL.ta"; export { Path, _decode_Path, _encode_Path } from "../PKCS-15/Path.ta"; export { URL, _decode_URL, _encode_URL } from "../PKCS-15/URL.ta"; /** * @summary ReferencedValue * @description * * ### ASN.1 Definition: * * ```asn1 * ReferencedValue {Type} ::= CHOICE { * path Path, * url URL * } (CONSTRAINED BY {-- 'path' or 'url' shall point to an object of type -- Type}) * ``` */ export declare type ReferencedValue<Type> = { path: Path; } | { url: URL; }; /** * @summary Returns a function that will decode an ASN.1 element into a(n) ReferencedValue * @function * @param {_Element} el The element being decoded. * @returns A function that will decode an ASN.1 element. */ export declare function _get_decoder_for_ReferencedValue<Type>(_decode_Type: $.ASN1Decoder<Type>): $.ASN1Decoder<ReferencedValue<Type>>; /** * @summary Returns a function that will encode a(n) ReferencedValue into an ASN.1 Element. * @function * @returns A function that will encode a(n) ReferencedValue as an ASN.1 element. */ export declare function _get_encoder_for_ReferencedValue<Type>(_encode_Type: $.ASN1Encoder<Type>): $.ASN1Encoder<ReferencedValue<Type>>;