@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
149 lines (148 loc) • 5.22 kB
TypeScript
import { ASN1Element as _Element, OCTET_STRING, OPTIONAL } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { KeyEncryptionAlgorithmIdentifier } from "../PKCS7/KeyEncryptionAlgorithmIdentifier.ta";
import { OriginatorIdentifierOrKey } from "../PKCS7/OriginatorIdentifierOrKey.ta";
import { RecipientEncryptedKeys } from "../PKCS7/RecipientEncryptedKeys.ta";
import { Version } from "../PKCS7/Version.ta";
export { KeyEncryptionAlgorithmIdentifier, _decode_KeyEncryptionAlgorithmIdentifier, _encode_KeyEncryptionAlgorithmIdentifier, } from "../PKCS7/KeyEncryptionAlgorithmIdentifier.ta";
export { OriginatorIdentifierOrKey, _decode_OriginatorIdentifierOrKey, _encode_OriginatorIdentifierOrKey, } from "../PKCS7/OriginatorIdentifierOrKey.ta";
export { RecipientEncryptedKeys, _decode_RecipientEncryptedKeys, _encode_RecipientEncryptedKeys, } from "../PKCS7/RecipientEncryptedKeys.ta";
export { Version, _decode_Version, _encode_Version } from "../PKCS7/Version.ta";
/**
* @summary KeyAgreementRecipientInfo
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* KeyAgreementRecipientInfo ::= SEQUENCE {
* version Version,
* originator [0] OriginatorIdentifierOrKey,
* userKeyingMaterial [1] EXPLICIT OCTET STRING OPTIONAL,
* keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
* recipientEncryptedKeys RecipientEncryptedKeys
* }
* ```
*
* @class
*/
export declare class KeyAgreementRecipientInfo {
/**
* @summary `version`.
* @public
* @readonly
*/
readonly version: Version;
/**
* @summary `originator`.
* @public
* @readonly
*/
readonly originator: OriginatorIdentifierOrKey;
/**
* @summary `userKeyingMaterial`.
* @public
* @readonly
*/
readonly userKeyingMaterial: OPTIONAL<OCTET_STRING>;
/**
* @summary `keyEncryptionAlgorithm`.
* @public
* @readonly
*/
readonly keyEncryptionAlgorithm: KeyEncryptionAlgorithmIdentifier;
/**
* @summary `recipientEncryptedKeys`.
* @public
* @readonly
*/
readonly recipientEncryptedKeys: RecipientEncryptedKeys;
constructor(
/**
* @summary `version`.
* @public
* @readonly
*/
version: Version,
/**
* @summary `originator`.
* @public
* @readonly
*/
originator: OriginatorIdentifierOrKey,
/**
* @summary `userKeyingMaterial`.
* @public
* @readonly
*/
userKeyingMaterial: OPTIONAL<OCTET_STRING>,
/**
* @summary `keyEncryptionAlgorithm`.
* @public
* @readonly
*/
keyEncryptionAlgorithm: KeyEncryptionAlgorithmIdentifier,
/**
* @summary `recipientEncryptedKeys`.
* @public
* @readonly
*/
recipientEncryptedKeys: RecipientEncryptedKeys);
/**
* @summary Restructures an object into a KeyAgreementRecipientInfo
* @description
*
* This takes an `object` and converts it to a `KeyAgreementRecipientInfo`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `KeyAgreementRecipientInfo`.
* @returns {KeyAgreementRecipientInfo}
*/
static _from_object(_o: {
[_K in keyof KeyAgreementRecipientInfo]: KeyAgreementRecipientInfo[_K];
}): KeyAgreementRecipientInfo;
}
/**
* @summary The Leading Root Component Types of KeyAgreementRecipientInfo
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_1_spec_for_KeyAgreementRecipientInfo: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of KeyAgreementRecipientInfo
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_2_spec_for_KeyAgreementRecipientInfo: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of KeyAgreementRecipientInfo
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _extension_additions_list_spec_for_KeyAgreementRecipientInfo: $.ComponentSpec[];
/**
* @summary Decodes an ASN.1 element into a(n) KeyAgreementRecipientInfo
* @function
* @param {_Element} el The element being decoded.
* @returns {KeyAgreementRecipientInfo} The decoded data structure.
*/
export declare function _decode_KeyAgreementRecipientInfo(el: _Element): KeyAgreementRecipientInfo;
/**
* @summary Encodes a(n) KeyAgreementRecipientInfo 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 KeyAgreementRecipientInfo, encoded as an ASN.1 Element.
*/
export declare function _encode_KeyAgreementRecipientInfo(value: KeyAgreementRecipientInfo, elGetter: $.ASN1Encoder<KeyAgreementRecipientInfo>): _Element;