@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
179 lines (178 loc) • 5.82 kB
TypeScript
import { ASN1Element as _Element, OPTIONAL } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { Attributes } from "../PKCS7/Attributes.ta";
import { DigestAlgorithmIdentifier } from "../PKCS7/DigestAlgorithmIdentifier.ta";
import { DigestEncryptionAlgorithmIdentifier } from "../PKCS7/DigestEncryptionAlgorithmIdentifier.ta";
import { EncryptedDigest } from "../PKCS7/EncryptedDigest.ta";
import { SignerIdentifier } from "../PKCS7/SignerIdentifier.ta";
import { Version } from "../PKCS7/Version.ta";
export { Attributes, _decode_Attributes, _encode_Attributes, } from "../PKCS7/Attributes.ta";
export { DigestAlgorithmIdentifier, _decode_DigestAlgorithmIdentifier, _encode_DigestAlgorithmIdentifier, } from "../PKCS7/DigestAlgorithmIdentifier.ta";
export { DigestEncryptionAlgorithmIdentifier, _decode_DigestEncryptionAlgorithmIdentifier, _encode_DigestEncryptionAlgorithmIdentifier, } from "../PKCS7/DigestEncryptionAlgorithmIdentifier.ta";
export { EncryptedDigest, _decode_EncryptedDigest, _encode_EncryptedDigest, } from "../PKCS7/EncryptedDigest.ta";
export { SignerIdentifier, _decode_SignerIdentifier, _encode_SignerIdentifier, } from "../PKCS7/SignerIdentifier.ta";
export { Version, _decode_Version, _encode_Version } from "../PKCS7/Version.ta";
/**
* @summary SignerInfo
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* SignerInfo ::= SEQUENCE {
* version Version,
* signerIdentifier SignerIdentifier,
* digestAlgorithm DigestAlgorithmIdentifier,
* authenticatedAttributes [0] Attributes OPTIONAL,
* digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
* encryptedDigest EncryptedDigest,
* unauthenticatedAttributes [1] Attributes OPTIONAL
* }
* ```
*
* @class
*/
export declare class SignerInfo {
/**
* @summary `version`.
* @public
* @readonly
*/
readonly version: Version;
/**
* @summary `signerIdentifier`.
* @public
* @readonly
*/
readonly signerIdentifier: SignerIdentifier;
/**
* @summary `digestAlgorithm`.
* @public
* @readonly
*/
readonly digestAlgorithm: DigestAlgorithmIdentifier;
/**
* @summary `authenticatedAttributes`.
* @public
* @readonly
*/
readonly authenticatedAttributes: OPTIONAL<Attributes>;
/**
* @summary `digestEncryptionAlgorithm`.
* @public
* @readonly
*/
readonly digestEncryptionAlgorithm: DigestEncryptionAlgorithmIdentifier;
/**
* @summary `encryptedDigest`.
* @public
* @readonly
*/
readonly encryptedDigest: EncryptedDigest;
/**
* @summary `unauthenticatedAttributes`.
* @public
* @readonly
*/
readonly unauthenticatedAttributes: OPTIONAL<Attributes>;
constructor(
/**
* @summary `version`.
* @public
* @readonly
*/
version: Version,
/**
* @summary `signerIdentifier`.
* @public
* @readonly
*/
signerIdentifier: SignerIdentifier,
/**
* @summary `digestAlgorithm`.
* @public
* @readonly
*/
digestAlgorithm: DigestAlgorithmIdentifier,
/**
* @summary `authenticatedAttributes`.
* @public
* @readonly
*/
authenticatedAttributes: OPTIONAL<Attributes>,
/**
* @summary `digestEncryptionAlgorithm`.
* @public
* @readonly
*/
digestEncryptionAlgorithm: DigestEncryptionAlgorithmIdentifier,
/**
* @summary `encryptedDigest`.
* @public
* @readonly
*/
encryptedDigest: EncryptedDigest,
/**
* @summary `unauthenticatedAttributes`.
* @public
* @readonly
*/
unauthenticatedAttributes: OPTIONAL<Attributes>);
/**
* @summary Restructures an object into a SignerInfo
* @description
*
* This takes an `object` and converts it to a `SignerInfo`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `SignerInfo`.
* @returns {SignerInfo}
*/
static _from_object(_o: {
[_K in keyof SignerInfo]: SignerInfo[_K];
}): SignerInfo;
}
/**
* @summary The Leading Root Component Types of SignerInfo
* @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_SignerInfo: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of SignerInfo
* @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_SignerInfo: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of SignerInfo
* @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_SignerInfo: $.ComponentSpec[];
/**
* @summary Decodes an ASN.1 element into a(n) SignerInfo
* @function
* @param {_Element} el The element being decoded.
* @returns {SignerInfo} The decoded data structure.
*/
export declare function _decode_SignerInfo(el: _Element): SignerInfo;
/**
* @summary Encodes a(n) SignerInfo 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 SignerInfo, encoded as an ASN.1 Element.
*/
export declare function _encode_SignerInfo(value: SignerInfo, elGetter: $.ASN1Encoder<SignerInfo>): _Element;