@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
31 lines (30 loc) • 1.27 kB
JavaScript
import * as $ from "@wildboar/asn1/functional";
import { _decode_OtherPrimeInfo, _encode_OtherPrimeInfo, } from "../PKCS-1/OtherPrimeInfo.ta.mjs";
let _cached_decoder_for_OtherPrimeInfos = null;
/**
* @summary Decodes an ASN.1 element into a(n) OtherPrimeInfos
* @function
* @param {_Element} el The element being decoded.
* @returns {OtherPrimeInfos} The decoded data structure.
*/
export function _decode_OtherPrimeInfos(el) {
if (!_cached_decoder_for_OtherPrimeInfos) {
_cached_decoder_for_OtherPrimeInfos = $._decodeSequenceOf(() => _decode_OtherPrimeInfo);
}
return _cached_decoder_for_OtherPrimeInfos(el);
}
let _cached_encoder_for_OtherPrimeInfos = null;
/**
* @summary Encodes a(n) OtherPrimeInfos 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 OtherPrimeInfos, encoded as an ASN.1 Element.
*/
export function _encode_OtherPrimeInfos(value, elGetter) {
if (!_cached_encoder_for_OtherPrimeInfos) {
_cached_encoder_for_OtherPrimeInfos = $._encodeSequenceOf(() => _encode_OtherPrimeInfo, $.BER);
}
return _cached_encoder_for_OtherPrimeInfos(value, elGetter);
}
/* eslint-enable */