Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java Êý×ÖÖ¤ÊéÐÅÏ¢µÄ»ñȡʵÀý javaѧϰ±Ê¼Ç(2)

ÓÃjavaÌṩµÄapiʵÏÖ´ÓÖ¤ÊéÎļþ(±¾ÊµÀýʵÑé¶ÔÏóΪ*.cerÎļþ)ÖлñÈ¡ÓÐЧÐÅÏ¢µÄ·½·¨..
public static X509Certificate getCert(String fileName) throws Exception {//´ÓÒ»¸öÓÐЧµÄÖ¤ÊéÎļþÀ´´´½¨Ö¤Êé..
InputStream inStream = new FileInputStream(fileName);
CertificateFactory cf = CertificateFactory.getInstance("X.509");//ÓÃÖ¤Ê鹤³§À´´´½¨Ö¤Êé..
X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);
inStream.close();
return cert;
}
public static void showCert( X509Certificate cert ) {//Êä³öÖ¤ÊéµÄ¸÷ÏîÐÅÏ¢..
System.out.println("Version: " + cert.getVersion());//Ö¤Êé°æ±¾..
System.out.println("SerialNumber: " + cert.getSerialNumber().toString(16) );//Ö¤ÊéÐòÁкÅ..
System.out.println("SignatureAlgorithm: " + cert.getSigAlgName());//Ö¤ÊéÇ©ÃûËã·¨..
X500Principal principal = cert.getIssuerX500Principal();
System.out.println("IssuerName: \n" + principal.getName(X500Principal.RFC1779));//Ö¤Êé°ä·¢Õß
//System.out.println(principal.hashCode());
GregorianCalendar gcal = new GregorianCalendar();
System.out.print("Validityfrom: ");
gcal.setTime(cert.getNotBefore());//Ö¤ÊéÓÐЧÆÚ´Ó..
System.out.println(gcal.get(GregorianCalendar.YEAR)+"/"+gcal.get(GregorianCalendar.MONTH)+"/"+gcal.get(GregorianCalendar.DAY_OF_MONTH)+" "+gcal.get(GregorianCalendar.HOUR_OF_DAY)+":"+gcal.get(GregorianCalendar.MINUTE)+":"+gcal.get(GregorianCalendar.SECOND));
System.out.print("ValidityTo: ");
gcal.setTime(cert.getNotAfter());//Ö¤ÊéÓÐЧÆÚµ½..
System.out.println(gcal.get(GregorianCalendar.YEAR)+"/"+gcal.get(GregorianCalendar.MONTH)+"/"+gcal.get(GregorianCalendar.DAY_OF_MONTH)+" "+gcal.get(GregorianCalendar.HOUR_OF_DAY)+":"+gcal.get(GregorianCalendar.MINUTE)+":"+gcal.get(GregorianCalendar.SECOND));
principal = cert.getSubjectX500Principal();
System.out.println("SubjectName: \n" + principal.getName(X500Principal.RFC1779));//Ö¤ÊéʹÓÃÕß
PublicKey pkey = cert.getPublicKey();//»ñµÃ¹«Ô¿


Ïà¹ØÎĵµ£º

windows 7µÄjava»·¾³±äÁ¿

class_path
.;D:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;D:\Program Files\Java\jdk1.5.0_04\lib\rt.jar;D:\Program Files\Java\jdk1.5.0_04\lib\dt.jar;
path
D:\Program Files\Java\jdk1.5.0_04\bin;D:\Program Files\Java\jre1.5.0_04\bin
java_home
D:\Program Files\Java\jdk1.5.0_04
ÒÔÉÏÅäÖÃÊÇÎÒ»úÆ÷µ ......

·Ç³£¾­µäµÄjavaÃæÊÔ

ÃæÊÔ¹Ù£ºÊìϤÄÄÖÖÓïÑÔ
ӦƸÕߣºJava¡£
ÃæÊÔ¹Ù£ºÖªµÀʲô½ÐÀàô
ӦƸÕߣºÎÒÕâÈËʵÔÚ£¬¹¤×÷ŬÁ¦£¬²»ÖªµÀʲô½ÐÀÛ
Ãæ
ÊÔ¹Ù£ºÖªµÀʲôÊÇ°ü?
ӦƸÕߣºÎÒÕâÈËʵÔÚ? ƽ³£²»´ø°ü Ò²²»Óù«Ë¾×¼±¸ÁË
ÃæÊÔ¹Ù£ºÖªµÀʲôÊǽӿÚÂð?
ӦƸÕߣºÎÒÕâ¸öÈ˹¤
×÷ÈÏÕæ¡£´ÓÀ´²»ÕÒ½è¿Ú͵ÀÁ
ÃæÊÔ¹Ù£ºÖªµÀʲôÊǼ̳Ðô
ӦƸÕߣºÎÒ ......

JavaÖ®Servlet¿ª·¢Ê¾Àý

±¾ÎÄ°üÀ¨:
A: servletÔ´ÂëʵÀý
B: servlet²¿Êð
C: ¿Í»§¶ËÔ¶³Ìµ÷ÓÃ
D: servlet¿ª·¢µ÷Óù¤¾ß
A: servletÔ´ÂëʵÀý
package com.viewlinecn.userlogin.www.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http ......

±È½ÏÈ«ÃæµÄJava»·¾³ÅäÖÃ

windows xpÏÂÅäÖÃJDK»·¾³±äÁ¿£º
      1.°²×°JDK£¬°²×°¹ý³ÌÖпÉÒÔ×Ô¶¨Ò尲װĿ¼µÈÐÅÏ¢£¬ÀýÈçÎÒÃÇÑ¡Ôñ°²×°Ä¿Â¼ÎªD:\java\jdk1.5.0_08£»
¡¡ 2.°²×°Íê³Éºó£¬ÓÒ»÷“ÎҵĵçÄÔ”£¬µã»÷“ÊôÐÔ”£»
      3.Ñ¡Ôñ“¸ß¼¶”Ñ¡Ï£¬µã»÷“ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ