@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
58 lines (57 loc) • 2.92 kB
TypeScript
import { ASN1Element as _Element } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { PublicDHKeyAttributes } from "../PKCS-15/PublicDHKeyAttributes.ta";
import { PublicDSAKeyAttributes } from "../PKCS-15/PublicDSAKeyAttributes.ta";
import { PublicECKeyAttributes } from "../PKCS-15/PublicECKeyAttributes.ta";
import { PublicKEAKeyAttributes } from "../PKCS-15/PublicKEAKeyAttributes.ta";
import { PublicKeyObject } from "../PKCS-15/PublicKeyObject.ta";
import { PublicRSAKeyAttributes } from "../PKCS-15/PublicRSAKeyAttributes.ta";
export { PublicDHKeyAttributes, _decode_PublicDHKeyAttributes, _encode_PublicDHKeyAttributes, } from "../PKCS-15/PublicDHKeyAttributes.ta";
export { PublicDSAKeyAttributes, _decode_PublicDSAKeyAttributes, _encode_PublicDSAKeyAttributes, } from "../PKCS-15/PublicDSAKeyAttributes.ta";
export { PublicECKeyAttributes, _decode_PublicECKeyAttributes, _encode_PublicECKeyAttributes, } from "../PKCS-15/PublicECKeyAttributes.ta";
export { PublicKEAKeyAttributes, _decode_PublicKEAKeyAttributes, _encode_PublicKEAKeyAttributes, } from "../PKCS-15/PublicKEAKeyAttributes.ta";
export { PublicKeyObject, _get_decoder_for_PublicKeyObject, _get_encoder_for_PublicKeyObject, } from "../PKCS-15/PublicKeyObject.ta";
export { PublicRSAKeyAttributes, _decode_PublicRSAKeyAttributes, _encode_PublicRSAKeyAttributes, } from "../PKCS-15/PublicRSAKeyAttributes.ta";
/**
* @summary PublicKeyType
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* PublicKeyType ::= CHOICE {
* publicRSAKey PublicKeyObject {PublicRSAKeyAttributes},
* publicECKey [0] PublicKeyObject {PublicECKeyAttributes},
* publicDHKey [1] PublicKeyObject {PublicDHKeyAttributes},
* publicDSAKey [2] PublicKeyObject {PublicDSAKeyAttributes},
* publicKEAKey [3] PublicKeyObject {PublicKEAKeyAttributes},
* ... -- For future extensions
* }
* ```
*/
export declare type PublicKeyType = {
publicRSAKey: PublicKeyObject<PublicRSAKeyAttributes>;
} | {
publicECKey: PublicKeyObject<PublicECKeyAttributes>;
} | {
publicDHKey: PublicKeyObject<PublicDHKeyAttributes>;
} | {
publicDSAKey: PublicKeyObject<PublicDSAKeyAttributes>;
} | {
publicKEAKey: PublicKeyObject<PublicKEAKeyAttributes>;
} | _Element;
/**
* @summary Decodes an ASN.1 element into a(n) PublicKeyType
* @function
* @param {_Element} el The element being decoded.
* @returns {PublicKeyType} The decoded data structure.
*/
export declare function _decode_PublicKeyType(el: _Element): PublicKeyType;
/**
* @summary Encodes a(n) PublicKeyType 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 PublicKeyType, encoded as an ASN.1 Element.
*/
export declare function _encode_PublicKeyType(value: PublicKeyType, elGetter: $.ASN1Encoder<PublicKeyType>): _Element;