UNPKG

@wildboar/pkcs

Version:
41 lines (40 loc) 1.24 kB
import { ASN1Element as _Element, PrintableString } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { URL_urlWithDigest } from "../PKCS-15/URL-urlWithDigest.ta"; export { URL_urlWithDigest, _decode_URL_urlWithDigest, _encode_URL_urlWithDigest, } from "../PKCS-15/URL-urlWithDigest.ta"; /** * @summary URL * @description * * ### ASN.1 Definition: * * ```asn1 * URL ::= CHOICE { * url PrintableString, * urlWithDigest [3] SEQUENCE { * url IA5String, * digest DigestInfoWithDefault * } * } * ``` */ export declare type URL = { url: PrintableString; } | { urlWithDigest: URL_urlWithDigest; }; /** * @summary Decodes an ASN.1 element into a(n) URL * @function * @param {_Element} el The element being decoded. * @returns {URL} The decoded data structure. */ export declare function _decode_URL(el: _Element): URL; /** * @summary Encodes a(n) URL 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 URL, encoded as an ASN.1 Element. */ export declare function _encode_URL(value: URL, elGetter: $.ASN1Encoder<URL>): _Element;