It enables us to encrypt a text using an asymmetrical algorithm.
||For a given text, it returns it encrypted using asymmetrical cryptography according to the algorithm and the public key of the certificate specified.
||Returns the given text de-encrypted according to the algorithm and the private key of the certificate specified. A requirement is that the certificate must contain the private key.
||Enables the specification of the hash algorithms that will be used. SHA256 is used by default
||Allows us to specify the certificate that will be used for encrypting or de-encrypting.
The example below shows the encrypting of a text using a public key certificate.
&ErrorCode = &cryptoCert.Load("MyPublicKey.cer")
if &ErrorCode = 0
&CryptoEncrypt.Certificate = &cryptoCert //&CryptoEncrypt is of CryptoAsymmetricEncrypt type
&result = &CryptoEncrypt.Encrypt(&Text)
if &CryptoEncrypt.ErrCode <> 0
This example shows how to de-encrypt an encrypted text using an asymmetrical algorithm.
&ErrorCode = &cryptoCert.Load("MyPFX.pfx",&pwd) //&CryptoCert is of CryptoCertificate type.
if &ErrorCode= 0
&CryptoEncrypt.Certificate = &cryptoCert //&CryptoEncrypt is of the CryptoAsymmetricEncrypt type
- Smart Devices only support SHA256 (default) in Algorithm property. Other mechanisms are ignored.
||Web(.NET,Java), Smart Devices (iOS)
This data type is available as of GeneXus 15.
For Smart Devices enviroment, is available as of GeneXus 15 Upgrade 10.