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
- 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.
- 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)
||Web(.NET,Java), Smart Devices (Android e iOS)
This data type is available as of GeneXus 15.
For iOS is available as of Genexus 15 Upgrade 10.
For Android is available as of GeneXus 15 Upgrade 11.