CryptoManager.Encrypt

Syntax variant: Data in return value

Syntax:

Encrypt(<SourceData>, <Recipients>)

Parameters:

<SourceData> (required)

Type: String: BinaryData.
Source dara for encryption.
Data can be located in a file (in this case the name of file is specified) or represented as BinaryData.

<Recipients> (required)

Type: CryptoCertificate: Array.
The parameter can contain one certificate or an array of certificate objects.
Only recipients from the specified list (the recipients who have transferred certificates) will be able to decrypt the data using their private keys.

Description of method variant:

The encrypted data are returned with the method like BinaryData.

Syntax variant: Save data to a file

Syntax:

Encrypt(<SourceData>, <OutputData>, <Recipients>)

Parameters:

<SourceData> (required)

Type: String: BinaryData.
Source data for encryption.
Data can be located in a file (in this case the name of file is specified) or represented as BinaryData.

<OutputData> (required)

Type: String.
Name of file, to which the encrypted data is downloaded.

<Recipients> (required)

Type: CryptoCertificate: Array.
The parameter can contain one certificate or an array of certificates.
Only recipients from the specified list (the recipients who have transferred certificates) will be able to decrypt the data using their private keys.

Description of method variant:

Encrypted data is written to a file. Returns Undefined.

Returned value:

Type: Undefined; BinaryData.

Description:

Performs the data encryption for defined users. Only users from defined list can decrypt the data using their keys.
The format of encrypted data is PKCS#7.
Uses the algorithm, specified in property EncryptAlgorithm.

Availability:

Thin client, web-client, server, thick client, external connection.

See also:

CryptoManager, method BeginEncrypting

    

1C:Enterprise Developer's Community