beauty09
发贴: 4
积分: 0
|
于 2009-10-11 13:08
一个错误, NetBeans 显示 找不到 main.java. Exception in thread "main" java.lang.UnsupportedOperationException: Not yet implemented
import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; //import javax.crypto.spec.IvParameterSpec; //import javax.crypto.Cipher;
public class Main {
public static void main(String[] unused) throws Exception {
String xform = "Id\tProject name\titem amount\tCost\n1\tAC peanut375GM\t2\t" +"$3.00\n2\tSweet photatoes\t1kg\t$2.48\nTotal cost\t\t$8.48";
// String xform = "DES/ECB/PKCS5Padding";
// Generate a secret key KeyGenerator kg = KeyGenerator.getInstance("DES"); kg.init(56); // 56 is the keysize. Fixed for DES SecretKey key = kg.generateKey();
//Ism not sure what the text of dataBytes below byte[] dataBytes = "J2EE Security for Servlets, EJBs and Web Services".getBytes();
byte[] encBytes = encrypt(dataBytes, key,xform);
System.out.print(dataBytes); byte[] decBytes = decrypt(encBytes, key, xform); System.out.print(decBytes); } } private static byte[] decrypt(byte[] encBytes, SecretKey key, String xform) { throw new UnsupportedOperationException("Not yet implemented"); }
private static byte[] encrypt(byte[] dataBytes, SecretKey key, String xform) { throw new UnsupportedOperationException("Not yet implemented"); } }
|