UNPKG

@wildboar/pkcs

Version:
58 lines (57 loc) 3 kB
import { ASN1Element as _Element } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; import { PrivateDHKeyAttributes } from "../PKCS-15/PrivateDHKeyAttributes.ta"; import { PrivateDSAKeyAttributes } from "../PKCS-15/PrivateDSAKeyAttributes.ta"; import { PrivateECKeyAttributes } from "../PKCS-15/PrivateECKeyAttributes.ta"; import { PrivateKEAKeyAttributes } from "../PKCS-15/PrivateKEAKeyAttributes.ta"; import { PrivateKeyObject } from "../PKCS-15/PrivateKeyObject.ta"; import { PrivateRSAKeyAttributes } from "../PKCS-15/PrivateRSAKeyAttributes.ta"; export { PrivateDHKeyAttributes, _decode_PrivateDHKeyAttributes, _encode_PrivateDHKeyAttributes, } from "../PKCS-15/PrivateDHKeyAttributes.ta"; export { PrivateDSAKeyAttributes, _decode_PrivateDSAKeyAttributes, _encode_PrivateDSAKeyAttributes, } from "../PKCS-15/PrivateDSAKeyAttributes.ta"; export { PrivateECKeyAttributes, _decode_PrivateECKeyAttributes, _encode_PrivateECKeyAttributes, } from "../PKCS-15/PrivateECKeyAttributes.ta"; export { PrivateKEAKeyAttributes, _decode_PrivateKEAKeyAttributes, _encode_PrivateKEAKeyAttributes, } from "../PKCS-15/PrivateKEAKeyAttributes.ta"; export { PrivateKeyObject, _get_decoder_for_PrivateKeyObject, _get_encoder_for_PrivateKeyObject, } from "../PKCS-15/PrivateKeyObject.ta"; export { PrivateRSAKeyAttributes, _decode_PrivateRSAKeyAttributes, _encode_PrivateRSAKeyAttributes, } from "../PKCS-15/PrivateRSAKeyAttributes.ta"; /** * @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 declare 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} el The element being decoded. * @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;