UNPKG

@wildboar/rose

Version:
49 lines (48 loc) 1.74 kB
/* eslint-disable */ import { ASN1TagClass as _TagClass, } from '@wildboar/asn1'; import * as $ from '@wildboar/asn1/functional'; let _cached_decoder_for_Bind = null; /** * @summary Decodes an ASN.1 element into a(n) Bind * @function * @param {_Element} el The element being decoded. * @returns {Bind} The decoded data structure. */ export function _decode_Bind(el) { if (!_cached_decoder_for_Bind) { _cached_decoder_for_Bind = $._decode_inextensible_choice({ 'CONTEXT 16': [ 'bind_invoke', $._decode_explicit(() => $._decodeAny), ], 'CONTEXT 17': [ 'bind_result', $._decode_explicit(() => $._decodeAny), ], 'CONTEXT 18': [ 'bind_error', $._decode_explicit(() => $._decodeAny), ], }); } return _cached_decoder_for_Bind(el); } let _cached_encoder_for_Bind = null; /** * @summary Encodes a(n) Bind 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 Bind, encoded as an ASN.1 Element. */ export function _encode_Bind(value, elGetter) { if (!_cached_encoder_for_Bind) { _cached_encoder_for_Bind = $._encode_choice({ bind_invoke: $._encode_explicit(_TagClass.context, 16, () => $._encodeAny, $.BER), bind_result: $._encode_explicit(_TagClass.context, 17, () => $._encodeAny, $.BER), bind_error: $._encode_explicit(_TagClass.context, 18, () => $._encodeAny, $.BER), }, $.BER); } return _cached_encoder_for_Bind(value, elGetter); } /* eslint-enable */