CreaSign

CreaSign.Encrypt Method 

Encrypts the specified data.

[Visual Basic]
Public Function Encrypt( _
   ByVal CertName As String, _
   ByVal Data As Data, _
   ByVal Algorithm As String _
) As Data

Parameters

CertName
The digital certificate, the public key of which is used for encryption. See also "Specifying the Signing Certificate".
Data
The data that should be encrypted.
Algorithm
The identifier of the symetric encryption algorithm and encryption standard (encrypted data format).

Return Value

 Encrypted data in PKCS#7 format or XML document encrypted using XML-ENC standard. Xml-Enc is a widely accepted W3C standard that is more commonly used in modern applications. PKCS #7 is primarily purposed for compatibility with legacy systems.

Remarks

The digital certificate specified in the CertName parameter must be installed in an appropriate certificate store. Its private key is not used in the encryption process. The data is first encrypted with a symmetric algorithm specified in the Algorithm parameter. The symmetric encryption key is then encrypted with the certificate's public key. The following symetric algorithms are supported:

 

When using DES, 3DES, RC2, RC4 algoritm identifiers, the resulting encrypted data is returned in PKCS #7 format.

When using XML_3DES-RSA on an XML document, it will be encrypted using XML-ENC standard (http://www.w3.org/TR/xmlenc-core/#sec-eg-Element).

When using XML_3DES-RSA_BIN on a binary file, the result is an XML document containing encrypted data using XML-ENC standard (http://www.w3.org/TR/xmlenc-core/#sec-eg-Arbitrary-Data).

Requirements

Requires CreaSign Pro (not supported by CreaSign Lite).

See Also

CreaSign Class | CreaSign Namespace


Send comments on this topic.

(c) CREA 2002-2007 www.creasign.si