這是網上google的
-genkey 在用戶主目錄中創建一個默認文件".keystore",還會產生一個mykey的別名,mykey中包含用戶的公鑰、私鑰和證書
-alias 產生別名
-keystore 指定密鑰庫的名稱(產生的各類信息將不在.keystore文件中
-keyalg 指定密鑰的算法
-validity 指定創建的證書有效期多少天
-keysize 指定密鑰長度
-storepass 指定密鑰庫的密碼
-keypass 指定別名條目的密碼
-dname 指定證書擁有者信息 例如: "CN=sagely,OU=atr,O=szu,L=sz,ST=gd,C=cn"
-list 顯示密鑰庫中的證書信息 keytool -list -v -keystore sage -storepass ....
-v 顯示密鑰庫中的證書詳細信息
-export 將別名指定的證書導出到文件 keytool -export -alias caroot -file caroot.crt
-file 參數指定導出到文件的文件名
-delete 刪除密鑰庫中某條目 keytool -delete -alias sage -keystore sage
-keypasswd 修改密鑰庫中指定條目口令 keytool -keypasswd -alias sage -keypass .... -new .... -storepass ... -keystore sage
-import 將已簽名數字證書導入密鑰庫 keytool -import -alias sage -keystore sagely -file sagely.crt
導入已簽名數字證書用keytool -list -v 以后可以明顯發現多了認證鏈長度,并且把整個CA鏈全部打印出來。
posted @
2005-10-29 21:46 nake 閱讀(392) |
評論 (0) |
編輯 收藏
package publictool.cellEditor;
import java.awt.Component;
import java.awt.Frame;
import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.EventObject;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;
import rootwindow.ValueMap;
import com.borland.jb.io.InputStreamToByteArray;
public class ImageCellEditor extends AbstractCellEditor implements
TableCellEditor, ActionListener {
// 鼠標點擊次數
public int CLICKCOUNT = 2;
JButton button;
// button 命令的名稱
protected static final String EDIT = "CELLEDITOR";
// 對話框中確定的命令要是"OK"
protected static final String DIALOG_OK = "OK";
// 最終的返回一個object
Object curobject;
// 所有的彈出式窗口都必須是Dialog的子類
// 而且必須有getSelectInPut
// CellEditorDialog dialog1;
JDialog dialog1;
ValueMap valuemap;
Frame frame;
JFileChooserx jfc;
public ImageCellEditor(Frame frame, ValueMap valuemap) {
// super(frame, valuemap);
init();
}
public void init() {
System.out.println("sss1");
button = new JButton();
button.setActionCommand(EDIT);
button.addActionListener(this);
button.setBorderPainted(false);
/*
* dialog1 = new CellEditorDialog(frame, "", true, valuemap, "select
* bcode,bname from bcode", "bname", this, null);
*/
jfc = new JFileChooserx();
dialog1 = jfc.createDialog(frame);
jfc.addActionListener(this);
}
public Object getCellEditorValue() {
System.out.println("3");
return curobject;
}
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
System.out.println("4");
// curobject =jfc .getSelectedFile();
/*
File file = jfc.getSelectedFile();
InputStream is = null;
InputStreamToByteArray imputs = null;
byte[] b = new byte[102400];
if (file != null) {
try {
System.out.println("5");
is = new FileInputStream(file);
is.read(b);
imputs = new InputStreamToByteArray(b);
// imputs = (InputStreamToByteArray)is;
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
curobject = imputs;
//curobject = null;
}*/
curobject = value;
System.out.println("value = "+value);
System.out.println("getTableCellEditorComponent"+curobject);
return button;
}
// 默認鼠標雙擊才可以編輯
public boolean isCellEditable(EventObject anEvent) {
if (anEvent instanceof MouseEvent) {
return ((MouseEvent) anEvent).getClickCount() >= CLICKCOUNT;
}
return true;
}
/**
* Handles events from the editor button and from the dialog's OK button.
*/
public void actionPerformed(ActionEvent e) {
System.out.println("command=" + e.getActionCommand());
if (EDIT.equals(e.getActionCommand())) {
// The user has clicked the cell, so
// bring up the dialog.
dialog1.setVisible(true);
// Make the renderer reappear.
fireEditingStopped();
System.out.println("1");
} else if ("ApproveSelection".equals(e.getActionCommand())) { // User
// pressed
// dialog's
// "OK"
// button.
File file = jfc.getSelectedFile();
if (file != null) {
InputStream is = null;
InputStreamToByteArray imputs = null;
byte[] b = new byte[102400];
try {
System.out.println("6");
is = new FileInputStream(file);
// InputStreamToByteArray imputs = new
// InputStreamToByteArray(null);
is.read(b);
imputs = new InputStreamToByteArray(b);
curobject = imputs;
// imputs = (InputStreamToByteArray)is;
// b = new byte[1024];
// is.read(b);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
dialog1.dispose();
}
else if ("CancelSelection".equals(e.getActionCommand())) {
dialog1.dispose();
}
}
class JFileChooserx extends JFileChooser implements ActionListener {
JDialog dialog = null;
public JFileChooserx() {
super();
}
public JDialog createDialog(Component parent) throws HeadlessException {
return dialog = super.createDialog(parent);
}
public void actionPerformed(ActionEvent e) {
if ("CancelSelection".equals(e.getActionCommand())) {
dialog.dispose();
}
}
}
}
有幾個地方要注意JFileChooser的createDialog(Component parent)是protected的,我要覆蓋它
jdbtable里存圖片是用InputStreamToByteArray 來存儲的,這里我還有個問題如何把讀出來的圖片,存到數據庫中。
我現在是讀取圖片--放在byte[]中--數據庫,這樣一來我不知道byte要設置多大的長度,在控制臺老報“Premature end of JPEG file”
但是這不是一個異常。
posted @
2005-10-23 23:34 nake 閱讀(968) |
評論 (0) |
編輯 收藏
唉,java,內存,速度。
再見了跟我四年的本本,誰叫這個世界上有java,誰叫你自己不會加速。計算機的速度快了嗎?為什么運行軟件的速度越來越慢。哦。是軟件越來越龐大,即使硬件速度越來越快,計算機的速度也不會直線上升。因為計算機是由硬件和軟件組成的。再見了本本,但我是不會賣掉你的,我可能拿你來研究linux或網絡,或者給爸爸上網用^_^。
不就是java嗎,用jb,eclipse多打開兩個也不怕。cpu要快的AMD,內存我加雙通道(半年后),硬盤SATA的。
posted @
2005-10-20 22:34 nake 閱讀(450) |
評論 (0) |
編輯 收藏
天河、花園線班車非高峰期調整時刻表(9月22日) 麗江車隊將從2005年9月26日開始,對麗江班車的班次調整如下: 一、取消天河、花園班車非高峰運輸時段的班次,調整后的班車時刻表如下:
花園班車:(周一至周五)
發車時間
06:30 07:00 07:15 07:30 07:45 08:00 08:150 8:30
返程時間
07:15 07:45即停即走08:15即停即走08:45即停即走09:15
發車時間17:00 17:30 18:00 18:30 19:00 19:30
返程時間17:45 18:15 18:45 19:15 19:45 20:15
天河班車:(周一至周五)
發車時間
07:00 07:15 07:30 07:45 08:00 08:15 08:30 08:45
返程時間即停即走07:55即停即走08:25即停即走08:55即停即走09:25
發車時間
17:15 17:45 18:15 18:45 19:15 19:45
返程時間17:55 18:25 18:55 19:25 19:55 20:25
posted @
2005-10-18 23:31 nake 閱讀(268) |
評論 (0) |
編輯 收藏