com.nequi.api.utils.NequiEncrypter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nequi-api-client Show documentation
Show all versions of nequi-api-client Show documentation
SDK to use Nequi Api from Java.
package com.nequi.api.utils;
import java.security.PublicKey;
import javax.crypto.Cipher;
import com.amazonaws.util.Base64;
/**
* Nequi - Bancolombia
*
* @author jomgarci Clase para la encripci?n del Token para CashOut
*
*/
public class NequiEncrypter {
public static String encryptRSA(String text, PublicKey key) throws Exception {
byte[] cipherText;
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, key);
cipherText = cipher.doFinal(text.getBytes());
return Base64.encodeAsString(cipherText);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy