UNPKG

ess-ts

Version:

Enhanced Security Services (ESS) in TypeScript

84 lines 5.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_ESSSecurityLabel = exports._decode_ESSSecurityLabel = exports._extension_additions_list_spec_for_ESSSecurityLabel = exports._root_component_type_list_2_spec_for_ESSSecurityLabel = exports._root_component_type_list_1_spec_for_ESSSecurityLabel = exports.ESSSecurityLabel = void 0; const tslib_1 = require("tslib"); const asn1_ts_1 = require("asn1-ts"); const $ = tslib_1.__importStar(require("asn1-ts/dist/node/functional")); const ESSPrivacyMark_ta_1 = require("../ExtendedSecurityServices-2006/ESSPrivacyMark.ta"); const SecurityCategories_ta_1 = require("../ExtendedSecurityServices-2006/SecurityCategories.ta"); const SecurityClassification_ta_1 = require("../ExtendedSecurityServices-2006/SecurityClassification.ta"); const SecurityPolicyIdentifier_ta_1 = require("../ExtendedSecurityServices-2006/SecurityPolicyIdentifier.ta"); class ESSSecurityLabel { constructor(security_policy_identifier, security_classification, privacy_mark, security_categories) { this.security_policy_identifier = security_policy_identifier; this.security_classification = security_classification; this.privacy_mark = privacy_mark; this.security_categories = security_categories; } static _from_object(_o) { return new ESSSecurityLabel(_o.security_policy_identifier, _o.security_classification, _o.privacy_mark, _o.security_categories); } } exports.ESSSecurityLabel = ESSSecurityLabel; exports._root_component_type_list_1_spec_for_ESSSecurityLabel = [ new $.ComponentSpec("security-policy-identifier", false, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 6), undefined, undefined), new $.ComponentSpec("security-classification", true, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 2), undefined, undefined), new $.ComponentSpec("privacy-mark", true, $.hasAnyTag, undefined, undefined), new $.ComponentSpec("security-categories", true, $.hasTag(asn1_ts_1.ASN1TagClass.universal, 17), undefined, undefined), ]; exports._root_component_type_list_2_spec_for_ESSSecurityLabel = []; exports._extension_additions_list_spec_for_ESSSecurityLabel = []; let _cached_decoder_for_ESSSecurityLabel = null; function _decode_ESSSecurityLabel(el) { if (!_cached_decoder_for_ESSSecurityLabel) { _cached_decoder_for_ESSSecurityLabel = function (el) { let security_policy_identifier; let security_classification; let privacy_mark; let security_categories; const callbacks = { "security-policy-identifier": (_el) => { security_policy_identifier = SecurityPolicyIdentifier_ta_1._decode_SecurityPolicyIdentifier(_el); }, "security-classification": (_el) => { security_classification = SecurityClassification_ta_1._decode_SecurityClassification(_el); }, "privacy-mark": (_el) => { privacy_mark = ESSPrivacyMark_ta_1._decode_ESSPrivacyMark(_el); }, "security-categories": (_el) => { security_categories = SecurityCategories_ta_1._decode_SecurityCategories(_el); }, }; $._parse_set(el, callbacks, exports._root_component_type_list_1_spec_for_ESSSecurityLabel, exports._extension_additions_list_spec_for_ESSSecurityLabel, exports._root_component_type_list_2_spec_for_ESSSecurityLabel, undefined); return new ESSSecurityLabel(security_policy_identifier, security_classification, privacy_mark, security_categories); }; } return _cached_decoder_for_ESSSecurityLabel(el); } exports._decode_ESSSecurityLabel = _decode_ESSSecurityLabel; let _cached_encoder_for_ESSSecurityLabel = null; function _encode_ESSSecurityLabel(value, elGetter) { if (!_cached_encoder_for_ESSSecurityLabel) { _cached_encoder_for_ESSSecurityLabel = function (value, elGetter) { return $._encodeSet([] .concat([ SecurityPolicyIdentifier_ta_1._encode_SecurityPolicyIdentifier(value.security_policy_identifier, $.BER), value.security_classification === undefined ? undefined : SecurityClassification_ta_1._encode_SecurityClassification(value.security_classification, $.BER), value.privacy_mark === undefined ? undefined : ESSPrivacyMark_ta_1._encode_ESSPrivacyMark(value.privacy_mark, $.BER), value.security_categories === undefined ? undefined : SecurityCategories_ta_1._encode_SecurityCategories(value.security_categories, $.BER), ]) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_ESSSecurityLabel(value, elGetter); } exports._encode_ESSSecurityLabel = _encode_ESSSecurityLabel; //# sourceMappingURL=ESSSecurityLabel.ta.js.map