@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
60 lines • 2.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_URL = exports._decode_URL = exports._encode_URL_urlWithDigest = exports._decode_URL_urlWithDigest = exports.URL_urlWithDigest = void 0;
/* eslint-disable */
const asn1_ts_1 = require("asn1-ts");
const $ = require("asn1-ts/dist/node/functional");
const URL_urlWithDigest_ta_1 = require("../PKCS-15/URL-urlWithDigest.ta");
var URL_urlWithDigest_ta_2 = require("../PKCS-15/URL-urlWithDigest.ta");
Object.defineProperty(exports, "URL_urlWithDigest", { enumerable: true, get: function () { return URL_urlWithDigest_ta_2.URL_urlWithDigest; } });
Object.defineProperty(exports, "_decode_URL_urlWithDigest", { enumerable: true, get: function () { return URL_urlWithDigest_ta_2._decode_URL_urlWithDigest; } });
Object.defineProperty(exports, "_encode_URL_urlWithDigest", { enumerable: true, get: function () { return URL_urlWithDigest_ta_2._encode_URL_urlWithDigest; } });
/* END_OF_SYMBOL_DEFINITION URL */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_URL */
let _cached_decoder_for_URL = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_URL */
/* START_OF_SYMBOL_DEFINITION _decode_URL */
/**
* @summary Decodes an ASN.1 element into a(n) URL
* @function
* @param {_Element} el The element being decoded.
* @returns {URL} The decoded data structure.
*/
function _decode_URL(el) {
if (!_cached_decoder_for_URL) {
_cached_decoder_for_URL = $._decode_inextensible_choice({
"UNIVERSAL 19": ["url", $._decodePrintableString],
"CONTEXT 3": [
"urlWithDigest",
$._decode_implicit(() => URL_urlWithDigest_ta_1._decode_URL_urlWithDigest),
],
});
}
return _cached_decoder_for_URL(el);
}
exports._decode_URL = _decode_URL;
/* END_OF_SYMBOL_DEFINITION _decode_URL */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_URL */
let _cached_encoder_for_URL = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_URL */
/* START_OF_SYMBOL_DEFINITION _encode_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.
*/
function _encode_URL(value, elGetter) {
if (!_cached_encoder_for_URL) {
_cached_encoder_for_URL = $._encode_choice({
url: $._encodePrintableString,
urlWithDigest: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 3, () => URL_urlWithDigest_ta_1._encode_URL_urlWithDigest, $.BER),
}, $.BER);
}
return _cached_encoder_for_URL(value, elGetter);
}
exports._encode_URL = _encode_URL;
/* END_OF_SYMBOL_DEFINITION _encode_URL */
/* eslint-enable */
//# sourceMappingURL=URL.ta.js.map