UNPKG

@wildboar/pkcs

Version:
22 lines (21 loc) 1.21 kB
import { _decode_CommonKeyAttributes, _encode_CommonKeyAttributes, } from "../PKCS-15/CommonKeyAttributes.ta.mjs"; import { _decode_CommonSecretKeyAttributes, _encode_CommonSecretKeyAttributes, } from "../PKCS-15/CommonSecretKeyAttributes.ta.mjs"; import { _get_decoder_for_PKCS15Object, _get_encoder_for_PKCS15Object, } from "../PKCS-15/PKCS15Object.ta.mjs"; /** * @summary Returns a function that will decode an ASN.1 element into a(n) SecretKeyObject * @function * @param {_Element} el The element being decoded. * @returns A function that will decode an ASN.1 element. */ export function _get_decoder_for_SecretKeyObject(_decode_KeyAttributes) { return _get_decoder_for_PKCS15Object(_decode_CommonKeyAttributes, _decode_CommonSecretKeyAttributes, _decode_KeyAttributes); } /** * @summary Returns a function that will encode a(n) SecretKeyObject into an ASN.1 Element. * @function * @returns A function that will encode a(n) SecretKeyObject as an ASN.1 element. */ export function _get_encoder_for_SecretKeyObject(_encode_KeyAttributes) { return _get_encoder_for_PKCS15Object(_encode_CommonKeyAttributes, _encode_CommonSecretKeyAttributes, _encode_KeyAttributes); } /* eslint-enable */