2010-07-17 8 views
0

Quelqu'un pourrait me dire ce que les classes/méthodes .NET équivalentes sont les méthodes Java suivantes:.NET équivalents à des choses Java Crypto

decryptCipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); 
decryptCipher.init(2, getKey(0)); 
decryptCipher.doFinal(data); 

où retourne getKey() un objet de type SecretKeySpec (données est factice):

public static Key getKey(int cipher) { 
    if (cipher == 0) { 
     return new SecretKeySpec(new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 }, "DES"); 
    } 
    return new SecretKeySpec(new byte[] { 2, 2, 2, 2, 2, 2, 2, 2 }, "DES"); 
    } 

Un grand merci

Tony

Répondre

Questions connexes