java Êý×ÖÖ¤ÊékeytoolÓ÷¨
java
Êý×ÖÖ¤ÊékeytoolÓ÷¨
2009-06-14
21:05
Java ÖÐµÄ keytool.exe £¨Î»ÓÚ
JDK\Bin Ŀ¼Ï£©¿ÉÒÔÓÃÀ´´´½¨Êý×ÖÖ¤Ê飬ËùÓеÄÊý×ÖÖ¤ÊéÊÇÒÔÒ»ÌõÒ»Ìõ(²ÉÓñðÃûÇø±ð)µÄÐÎʽ´æÈëÖ¤Êé¿âµÄÖУ¬Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé°üº¬¸ÃÌõÖ¤ÊéµÄ˽Կ£¬¹«Ô¿ºÍ¶ÔÓ¦µÄÊý×ÖÖ¤ÊéµÄÐÅÏ¢¡£Ö¤Êé¿âÖеÄÒ»ÌõÖ¤Êé¿ÉÒÔµ¼³öÊý×ÖÖ¤ÊéÎļþ£¬Êý×ÖÖ¤ÊéÎļþÖ»°üÀ¨Ö÷ÌåÐÅÏ¢ºÍ¶ÔÓ¦µÄ¹«Ô¿¡£
KeytoolÊÇÒ»¸öJavaÊý¾ÝÖ¤ÊéµÄ¹ÜÀí¹¤¾ß¡£
keystore
Keytool½«ÃÜÔ¿£¨key£©ºÍÖ¤Ê飨certificates£©´æÔÚÒ»¸ö³ÆΪkeystoreµÄÎļþÖÐÔÚkeystoreÀ°üº¬Á½ÖÖÊý¾Ý£º
ÃÜԿʵÌ壨Key entity£©——ÃÜÔ¿£¨secret key£©ÓÖ»òÕßÊÇ˽ԿºÍÅä¶Ô¹«Ô¿£¨²ÉÓ÷ǶԳƼÓÃÜ£©
¿ÉÐÅÈεÄÖ¤ÊéʵÌ壨trusted certificate
entries£©——Ö»°üº¬¹«Ô¿
Alias£¨±ðÃû£©
ÿ¸ökeystore¶¼¹ØÁªÕâÒ»¸ö¶ÀÒ»ÎÞ¶þµÄalias£¬Õâ¸öaliasͨ³£²»Çø·Ö´óСд
keystoreµÄ´æ´¢Î»ÖÃ
ÔÚûÓÐÖƶ¨Éú³ÉλÖõÄÇé¿öÏ£¬keystore»á´æÔÚÓëÓû§µÄϵͳĬÈÏĿ¼£¬
È磺¶ÔÓÚwindow xpϵͳ£¬»áÉú³ÉÔÚϵͳµÄC:\Documents and Settings\UserName\
ÎļþÃûΪ“.keystore”
keystoreµÄÉú³É
ÒýÓÃkeytool
-genkey -alias tomcat -keyalg RSA -keystore d:\mykeystore -dname
"CN=localhost, OU=localhost, O=localhost, L=SH, ST=SH, C=CN"
-keypass changeit -storepass -validity 180
²ÎÊý˵Ã÷£º
-genkey±íʾҪ´´½¨Ò»¸öеÄÃÜÔ¿
-dname±íʾÃÜÔ¿µÄDistinguished Names£¬
CN=commonName
OU=organizationUnit
O=organizationName
L=localityName
S=stateName
C=country
Distinguished Names±íÃ÷ÁËÃÜÔ¿µÄ·¢ÐÐÕßÉí·Ý
-keyalgʹÓüÓÃܵÄËã·¨£¬ÕâÀïÊÇRSA
-aliasÃÜÔ¿µÄ±ðÃû
-keypass˽ÓÐÃÜÔ¿µÄÃÜÂ룬ÕâÀïÉèÖÃΪchangeit
-keystore ÃÜÔ¿±£´æÔÚD:ÅÌĿ¼ÏµÄmykeystoreÎļþÖÐ
-storepass ´æÈ¡ÃÜÂ룬ÕâÀïÉèÖÃΪchangeit£¬Õâ¸öÃÜÂëÌṩϵͳ´ÓmykeystoreÎļþÖн«ÐÅϢȡ³ö
-validity¸ÃÃÜÔ¿µÄÓÐЧÆÚΪ 180Ìì (ĬÈÏΪ90Ìì)
1£¬²úÉúÒ»¸öÃÜÔ¿¶Ô
keytool -genkey -alias mykeypair
-keypass mykeypairpwd
¹ý³ÌÈçÏ£º
&n
Ïà¹ØÎĵµ£º
1.´´½¨²âÊÔ±í
create table users(
userid int primary key,
username varchar2(20),
userpwd varchar2(20)
);
insert into users values(1,'test','test');
insert into users values(2,'test','test');
insert into users values(3,'test','test');
insert into users values(4,'test','test');
insert i ......
Ç°²»¾ÃдÁ˸öÏÂÔØÎļþµÄ·½·¨¡£¾¹ýÒ»¶Îʱ¼äÔÚ³ÌÐòÖеÄÔËÓ㬷¢ÏÖÁ˼¸¸öÎÊÌâ¡£ÐÞÕýһϣº
public static File saveToFiles(String destUrl,String path) throws IOException {
final int BUFFER_SIZE = 4096;
&nb ......
ÎÒÄܳéÏó³öÕû¸öÊÀ½ç£®£®£®
µ«ÊÇÎÒ²»ÄܳéÏó³öÄ㣮£®£®
ÒòΪÄãÔÚÎÒÐÄÖÐÊÇÄÇôµÄ¾ßÌ壮£®£®
ËùÒÔÎÒµÄÊÀ½ç²¢²»ÍêÕû£®£®£®
ÎÒ¿ÉÒÔÖØÔØÉõÖÁ¸²¸ÇÕâ¸öÊÀ½çÀïµÄÈκÎÒ»ÖÖ·½·¨£®£®£®
µ«ÊÇÎÒÈ´²»ÄÜÖØÔضÔÄãµÄ˼Ä£®£®
Ò²ÐíÃüÖÐ×¢¶¨ÁË ÄãÔÚÎÒµÄÊÀ½çÀïÓÀÔ¶µÄÀÓÉÏÁ˾²Ì¬µÄÊôÐÔ£®£®£®
¶øÎÒ²»É÷µ÷ÓÃÁË°®ÄãÕâ¸ö·½·¨£®£®£®
µ ......
Ãô½Ý¿ª·¢µÄÀíÄîÒѾÁ÷ÐÐÁ˺ܳ¤µÄʱ¼ä£¬ÔÚÃô½Ý¿ª·¢ÖеĿª·¢µü´ú½×¶ÎÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýÎå¸ö²½Ö裬À´ÓÐЧµÄÌá¸ßÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿¡£
JavaÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÓÉÓÚ¿ª·¢ÈËÔ±µÄ¾Ñé¡¢Java´úÂë±àдϰ¹ß£¬ÒÔ¼°È±·¦Í³Ò»µÄ±ê×¼ºÍ¹ÜÀíÁ÷³Ì£¬ÍùÍùµ¼ÖÂÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿½Ï²î£¬ÄÑÓÚά »¤£¬ÐèÒª½Ï´óµÄ²âÊÔͶÈëºÍÖÜÆÚµÈÎÊÌâ¡£ÕâЩÎÊÌâÔÚÒ»¸öÏ ......
Java ÊÇÒÔÀࣨclass£©µÄÐÎʽÀ´×éÖ¯³ÌÐò£¬²¢ÇÒ»¹Ó²ÐԹ涨£¬ËùÓÐÀàµÄµÄ¸ù½Úµã¶¼ÊÇObjectÀ࣬ÆäÓàµÄ¶¼ÊÇÆä×ÓÀà¡£
Java½öÖ§³Öµ¥¼Ì³Ð£¬¼´Ò»¸öÀàÖ»ÄÜÓÐÒ»¸ö¸¸Àà¡£
Java²»µ¥ÊÇÒ»¸öÃæÏò¶ÔÏóµÄ±à³ÌÓïÑÔ£¬ ³ýÁËÖ§³Ö¶ÔÏóÊý¾ÝÀàÐÍÍ⣬»¹Ö§³ÖһЩ»ù´¡Êý¾ÝÀàÐÍ£¬ÈçÕûÐÍ¡¢ÊµÐÍ¡¢×Ö·ûÐͺͲ¼¶ûÀàÐ͵ȡ£
JavaÓïÑÔµÄÓ¦ÓóÌÐò±à³ ......