RSA/ECB/OAEPWithSHA-256AndMGF1Padding

28 Views Asked by At

I have a situation where a Java program encrypts text using RSA/ECB/OAEPWithSHA-256AndMGF1Padding.

I need to do it in c# like java.

this is my java code

public static final byte[] encryptRSA(PublicKey publicKey, String plaintext) throws Exception {     
        Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");   
        cipher.init(Cipher.ENCRYPT_MODE, publicKey);    
        return cipher.doFinal(plaintext.getBytes());
    }

i want know to convert this java code to C#

0

There are 0 best solutions below