I have this java function and I want to change it to PHP openSSL
could you please guide me

public static String getIPINBlock(String ipin, String publicKey, String
uuid) 
{
        byte[] keyByte = Base64.decode(publicKey);
        X509EncodedKeySpec s = new X509EncodedKeySpec(keyByte);
        KeyFactory factory = KeyFactory.getInstance("RSA");
        Key pubKey = factory.generatePublic(s);
        Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
        cipher.init(Cipher.ENCRYPT_MODE, pubKey);
        ipin = (new String(Base64.encode(cipher.doFinal(ipin.getBytes())))); 
        return ipin;
}




--
View this message in context: 
http://openssl.6102.n7.nabble.com/HELP-Java-RSA-ECB-PKCS1Padding-to-PHP-tp55196.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to