All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nequi.api.utils.NequiEncrypter Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
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