This documentation is valid for:

It enables us to encrypt a text using an asymmetrical algorithm. ## CryptoAsymmetricEncrypt Methods
## Properties
## Example## A. Encrypt a text using an asymmetrical encryption algorithm.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 //Process Errors endif endif ## B. De-encrypting an encrypted text with an asymmetrical algorithm.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 if &cryptoCert.HasPrivateKey() &CryptoEncrypt.Certificate = &cryptoCert //&CryptoEncrypt is of the CryptoAsymmetricEncrypt type &Text= &CryptoEncrypt.Decrypt(&EncryptedText) else //Process Errors endif else //Process Errors endif ## Notes- iOS only support
*SHA256*(default) in Algorithm property. Other algorithms are ignored. - Android uses
*RSA/ECB/OAEPWithSHA-256AndMGF1Padding*in Algorithm property when the developer indicates an unsupported algorithm. Supported algorithms: - AES/CBC/NoPadding (128) - AES/CBC/PKCS5Padding (128) - AES/ECB/NoPadding (128) - AES/ECB/PKCS5Padding (128) - DES/CBC/NoPadding (56) - DES/CBC/PKCS5Padding (56) - DES/ECB/NoPadding (56) - DES/ECB/PKCS5Padding (56) - DESede/CBC/NoPadding (168) - DESede/CBC/PKCS5Padding (168) - DESede/ECB/NoPadding (168) - DESede/ECB/PKCS5Padding (168) - RSA/ECB/PKCS1Padding (1024, 2048) - RSA/ECB/OAEPWithSHA-1AndMGF1Padding (1024, 2048) - RSA/ECB/OAEPWithSHA-256AndMGF1Padding (1024, 2048)
## Scope
## AvailabilityThis data type is available as of GeneXus 15. |