in.s8.rsa.controller.EncrptController Maven / Gradle / Ivy
package in.s8.rsa.controller;
import in.s8.rsa.Service.EncryptionService;
import in.s8.rsa.constant.S8Constant;
import in.s8.rsa.impl.EncryptImpl;
import in.s8.rsa.implService.DecryptService;
import in.s8.rsa.implService.EncryptService;
import org.springframework.stereotype.Component;
import javax.crypto.Cipher;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.ObjectInputStream;
import java.security.interfaces.RSAPublicKey;
/**
* @desc Encryption Service
*
* Created by Sourabh_Sethi on 4/26/2016.
* @Author Sourabh Sethi
*/
@Component("encryptionService")
public class EncrptController implements EncryptionService {
EncryptService encryptService = new EncryptImpl();
public String encryptionString(String plainText, RSAPublicKey rsaPK) throws FileNotFoundException {
String cipherText = null;
cipherText = encryptService.encryptionByteStream(plainText, rsaPK).toString();
return cipherText;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy