@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
68 lines • 4.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_ExternalAuthObjectAttributes = exports._decode_ExternalAuthObjectAttributes = exports._encode_CertBasedAuthenticationAttributes = exports._decode_CertBasedAuthenticationAttributes = exports.CertBasedAuthenticationAttributes = exports._encode_AuthKeyAttributes = exports._decode_AuthKeyAttributes = exports.AuthKeyAttributes = void 0;
/* eslint-disable */
const asn1_ts_1 = require("asn1-ts");
const $ = require("asn1-ts/dist/node/functional");
const AuthKeyAttributes_ta_1 = require("../PKCS-15/AuthKeyAttributes.ta");
const CertBasedAuthenticationAttributes_ta_1 = require("../PKCS-15/CertBasedAuthenticationAttributes.ta");
var AuthKeyAttributes_ta_2 = require("../PKCS-15/AuthKeyAttributes.ta");
Object.defineProperty(exports, "AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2.AuthKeyAttributes; } });
Object.defineProperty(exports, "_decode_AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2._decode_AuthKeyAttributes; } });
Object.defineProperty(exports, "_encode_AuthKeyAttributes", { enumerable: true, get: function () { return AuthKeyAttributes_ta_2._encode_AuthKeyAttributes; } });
var CertBasedAuthenticationAttributes_ta_2 = require("../PKCS-15/CertBasedAuthenticationAttributes.ta");
Object.defineProperty(exports, "CertBasedAuthenticationAttributes", { enumerable: true, get: function () { return CertBasedAuthenticationAttributes_ta_2.CertBasedAuthenticationAttributes; } });
Object.defineProperty(exports, "_decode_CertBasedAuthenticationAttributes", { enumerable: true, get: function () { return CertBasedAuthenticationAttributes_ta_2._decode_CertBasedAuthenticationAttributes; } });
Object.defineProperty(exports, "_encode_CertBasedAuthenticationAttributes", { enumerable: true, get: function () { return CertBasedAuthenticationAttributes_ta_2._encode_CertBasedAuthenticationAttributes; } });
/* END_OF_SYMBOL_DEFINITION ExternalAuthObjectAttributes */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_ExternalAuthObjectAttributes */
let _cached_decoder_for_ExternalAuthObjectAttributes = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_ExternalAuthObjectAttributes */
/* START_OF_SYMBOL_DEFINITION _decode_ExternalAuthObjectAttributes */
/**
* @summary Decodes an ASN.1 element into a(n) ExternalAuthObjectAttributes
* @function
* @param {_Element} el The element being decoded.
* @returns {ExternalAuthObjectAttributes} The decoded data structure.
*/
function _decode_ExternalAuthObjectAttributes(el) {
if (!_cached_decoder_for_ExternalAuthObjectAttributes) {
_cached_decoder_for_ExternalAuthObjectAttributes = $._decode_extensible_choice({
"UNIVERSAL 16": [
"authKeyAttributes",
AuthKeyAttributes_ta_1._decode_AuthKeyAttributes,
],
"CONTEXT 0": [
"certBasedAttributes",
$._decode_implicit(() => CertBasedAuthenticationAttributes_ta_1._decode_CertBasedAuthenticationAttributes),
],
});
}
return _cached_decoder_for_ExternalAuthObjectAttributes(el);
}
exports._decode_ExternalAuthObjectAttributes = _decode_ExternalAuthObjectAttributes;
/* END_OF_SYMBOL_DEFINITION _decode_ExternalAuthObjectAttributes */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_ExternalAuthObjectAttributes */
let _cached_encoder_for_ExternalAuthObjectAttributes = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_ExternalAuthObjectAttributes */
/* START_OF_SYMBOL_DEFINITION _encode_ExternalAuthObjectAttributes */
/**
* @summary Encodes a(n) ExternalAuthObjectAttributes 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 ExternalAuthObjectAttributes, encoded as an ASN.1 Element.
*/
function _encode_ExternalAuthObjectAttributes(value, elGetter) {
if (!_cached_encoder_for_ExternalAuthObjectAttributes) {
_cached_encoder_for_ExternalAuthObjectAttributes = $._encode_choice({
authKeyAttributes: AuthKeyAttributes_ta_1._encode_AuthKeyAttributes,
certBasedAttributes: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => CertBasedAuthenticationAttributes_ta_1._encode_CertBasedAuthenticationAttributes, $.BER),
}, $.BER);
}
return _cached_encoder_for_ExternalAuthObjectAttributes(value, elGetter);
}
exports._encode_ExternalAuthObjectAttributes = _encode_ExternalAuthObjectAttributes;
/* END_OF_SYMBOL_DEFINITION _encode_ExternalAuthObjectAttributes */
/* eslint-enable */
//# sourceMappingURL=ExternalAuthObjectAttributes.ta.js.map