function Encrypt(const Data: TBytes; Encoding: TScCMSEncoding = ceDER): TBytes; overload;

procedure Encrypt(InStream, OutStream: TStream; Encoding: TScCMSEncoding = ceDER); overload;

procedure Encrypt(const InFileName, OutFileName: string; Encoding: TScCMSEncoding = ceDER); overload;

 

Description

The Encrypt method encrypts the input data by using the certificate specified in the Certificate property, and encodes the result information into an enveloped CMS/PKCS #7 message.

This method can return an array of byte values that represents the encoded message or can write this result to the OutStream stream or to the OutFileName file.

 

Data is an array of byte values that represents the input data to be encrypted.

InStream is a TStream object that contains the input data to be encrypted.

InFileName is a name of the file that contains the input data to be encrypted.

OutStream is a TStream object that will contain the enveloped CMS/PKCS #7 message.

OutFileName is a name of the file that will contain the enveloped CMS/PKCS #7 message.

Encoding specifies the output encoded format.

 

The symmetric encryption algorithm can be specified by the EncryptionAlgorithm property.

Encrypt resets all properties of the EnvelopedData object that stores the information about the processed CMS/PKCS #7 message.

 

See Also

Decrypt

EncryptionAlgorithm

EnvelopedData

SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support