@wildboar/pki-stub
Version:
X.510 PKI-Stub ASN.1 data structures in TypeScript
52 lines • 2.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_PrivateDomainName = exports._decode_PrivateDomainName = void 0;
const $ = require("asn1-ts/dist/node/functional");
/* END_OF_SYMBOL_DEFINITION PrivateDomainName */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_PrivateDomainName */
let _cached_decoder_for_PrivateDomainName = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_PrivateDomainName */
/* START_OF_SYMBOL_DEFINITION _decode_PrivateDomainName */
/**
* @summary Decodes an ASN.1 element into a(n) PrivateDomainName
* @function
* @param {_Element} el The element being decoded.
* @returns {PrivateDomainName} The decoded data structure.
*/
function _decode_PrivateDomainName(el) {
if (!_cached_decoder_for_PrivateDomainName) {
_cached_decoder_for_PrivateDomainName =
$._decode_inextensible_choice({
"UNIVERSAL 18": ["numeric", $._decodeNumericString],
"UNIVERSAL 19": ["printable", $._decodePrintableString],
});
}
return _cached_decoder_for_PrivateDomainName(el);
}
exports._decode_PrivateDomainName = _decode_PrivateDomainName;
/* END_OF_SYMBOL_DEFINITION _decode_PrivateDomainName */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_PrivateDomainName */
let _cached_encoder_for_PrivateDomainName = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_PrivateDomainName */
/* START_OF_SYMBOL_DEFINITION _encode_PrivateDomainName */
/**
* @summary Encodes a(n) PrivateDomainName 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 PrivateDomainName, encoded as an ASN.1 Element.
*/
function _encode_PrivateDomainName(value, elGetter) {
if (!_cached_encoder_for_PrivateDomainName) {
_cached_encoder_for_PrivateDomainName =
$._encode_choice({
numeric: $._encodeNumericString,
printable: $._encodePrintableString,
}, $.BER);
}
return _cached_encoder_for_PrivateDomainName(value, elGetter);
}
exports._encode_PrivateDomainName = _encode_PrivateDomainName;
/* END_OF_SYMBOL_DEFINITION _encode_PrivateDomainName */
/* eslint-enable */
//# sourceMappingURL=PrivateDomainName.ta.js.map