@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
52 lines • 2.14 kB
text/typescript
import { ASN1Element as _Element } from "@wildboar/asn1";
import * as $ from "@wildboar/asn1/functional";
import { PublicDHKeyAttributes } from "../PKCS-15/PublicDHKeyAttributes.ta.mjs";
import { PublicDSAKeyAttributes } from "../PKCS-15/PublicDSAKeyAttributes.ta.mjs";
import { PublicECKeyAttributes } from "../PKCS-15/PublicECKeyAttributes.ta.mjs";
import { PublicKEAKeyAttributes } from "../PKCS-15/PublicKEAKeyAttributes.ta.mjs";
import { PublicKeyObject } from "../PKCS-15/PublicKeyObject.ta.mjs";
import { PublicRSAKeyAttributes } from "../PKCS-15/PublicRSAKeyAttributes.ta.mjs";
/**
* @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 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 The element being encoded.
* @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;
//# sourceMappingURL=PublicKeyType.ta.d.mts.map