UNPKG

@wildboar/pkcs

Version:
52 lines 2.2 kB
import { ASN1Element as _Element } from "@wildboar/asn1"; import * as $ from "@wildboar/asn1/functional"; import { PrivateDHKeyAttributes } from "../PKCS-15/PrivateDHKeyAttributes.ta.mjs"; import { PrivateDSAKeyAttributes } from "../PKCS-15/PrivateDSAKeyAttributes.ta.mjs"; import { PrivateECKeyAttributes } from "../PKCS-15/PrivateECKeyAttributes.ta.mjs"; import { PrivateKEAKeyAttributes } from "../PKCS-15/PrivateKEAKeyAttributes.ta.mjs"; import { PrivateKeyObject } from "../PKCS-15/PrivateKeyObject.ta.mjs"; import { PrivateRSAKeyAttributes } from "../PKCS-15/PrivateRSAKeyAttributes.ta.mjs"; /** * @summary PrivateKeyType * @description * * ### ASN.1 Definition: * * ```asn1 * PrivateKeyType ::= CHOICE { * privateRSAKey PrivateKeyObject {PrivateRSAKeyAttributes}, * privateECKey [0] PrivateKeyObject {PrivateECKeyAttributes}, * privateDHKey [1] PrivateKeyObject {PrivateDHKeyAttributes}, * privateDSAKey [2] PrivateKeyObject {PrivateDSAKeyAttributes}, * privateKEAKey [3] PrivateKeyObject {PrivateKEAKeyAttributes}, * ... -- For future extensions * } * ``` */ export type PrivateKeyType = { privateRSAKey: PrivateKeyObject<PrivateRSAKeyAttributes>; } | { privateECKey: PrivateKeyObject<PrivateECKeyAttributes>; } | { privateDHKey: PrivateKeyObject<PrivateDHKeyAttributes>; } | { privateDSAKey: PrivateKeyObject<PrivateDSAKeyAttributes>; } | { privateKEAKey: PrivateKeyObject<PrivateKEAKeyAttributes>; } | _Element; /** * @summary Decodes an ASN.1 element into a(n) PrivateKeyType * @function * @param {_Element} el The element being decoded. * @returns {PrivateKeyType} The decoded data structure. */ export declare function _decode_PrivateKeyType(el: _Element): PrivateKeyType; /** * @summary Encodes a(n) PrivateKeyType 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 PrivateKeyType, encoded as an ASN.1 Element. */ export declare function _encode_PrivateKeyType(value: PrivateKeyType, elGetter: $.ASN1Encoder<PrivateKeyType>): _Element; //# sourceMappingURL=PrivateKeyType.ta.d.mts.map