各位大侠下列这段JAVA代码如何用C#实现呢
public static SecretKey getKey(String key){
SecretKey deskey = null;
try {
KeyGenerator gen = KeyGenerator.getInstance(Algorithm);
SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
secureRandom.setSeed(key.getBytes());
gen.init(112, secureRandom);
deskey = gen.generateKey();
gen = null;
return deskey;
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return deskey;
}
能不能把问题描述清晰
几处getInstance()。需要用到其他的类啊。光是转换了这几行代码是不行滴。