JAVA£º°²È«Ö¤Êé ¹«Ô¿¼ÓÃÜ£¬Ë½Ô¿½âÃÜʾÀý³ÌÐò
import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import javax.crypto.Cipher;
// ¹«Ô¿¼ÓÃÜ£¬Ë½Ô¿½âÃÜʾÀý³ÌÐò
public class A {
public static void main(String[] args) throws Exception {
// ǰÌ᣺JDKÒѰ²×°ÇÒÕýÈ·ÅäÖû·¾³±äÁ¿
// Ê×ÏÈÔÚCÅ̽¨Á¢Ä¿Â¼ MyKeyStore£¬ÓÃÀ´´æ·ÅÖ¤Êé¿âÒÔ¼°µ¼³öµÄÖ¤ÊéÎļþ£¬È»ºóÔÚÃüÁîÐÐÖ´ÐÐÏÂÁÐ2¾ä
// Ͼ京Ò壺ÔÚµ±Ç°Ä¿Â¼´´½¨ TestStore ÃÜÔ¿¿â£¬¿âÃÜÂë aaaaaa £¬´´½¨Ö¤Êé TestKey2 £º·Ç¶Ô³ÆÃÜÔ¿£¬RSA Ëã·¨£¬keyÃÜÂëΪ bbbbbb £¬´æÓÚ TestStore
// C:\MyKeyStore > keytool -genkey -alias TestKey2 -dname "CN=test222" -keyalg RSA -keystore TestStore -storepass aaaaaa -keypass bbbbbb
// Ͼ京Ò壺½« TestStore ¿âÖÐµÄ TestKey2 µ¼³öΪ֤ÊéÎļþ TestKey2.cer £¬ÕâÀï¿ÉÄÜÐèÒª½« export ÐÞ¸ÄΪ exportcert
// C:\MyKeyStore > keytool -export -alias TestKey2 -file TestKey2.cer -keystore TestStore -storepass aaaaaa
// Ö¤Êé¿âÖ¤Êé±£´æÖ¤ÊéµÄ¹«Ë½Ô¿£¬µ¼³öµÄÖ¤ÊéÎļþֻЯ´ø¹«Ô¿
byte[] msg = "·¸´óººÌìÍþÕߣ¬ËäÔ¶±ØÖ".getBytes("UTF8"); // ´ý¼Ó½âÃܵÄÏûÏ¢
// ÓÃÖ¤ÊéµÄ¹«Ô¿¼ÓÃÜ
CertificateFactory cff = CertificateFactory.getInstance("X.509");
FileInputStream fis1 = new FileInputStream("C:\\MyKeyStore\\TestKey2.cer"); // Ö¤ÊéÎļþ
Certificate cf = cff.generateCertificate(fis1);
PublicKey pk1 = cf.getPublicKey(); // µÃµ½Ö¤ÊéÎļþЯ´øµÄ¹«Ô¿
Cipher c1 = Cipher.getInstance("RSA/ECB/PKCS1Padding"); // ¶¨ÒåËã·¨£ºRSA
c1.init(Cipher.ENCRYPT_MODE, pk1);
byte[] msg1 = c1.doFinal(msg); &nbs
Ïà¹ØÎĵµ£º
¶ÔÓÚJavaÓïÑÔ£¬×îÌåÌùµÄÒ»ÏîÉè¼Æ¾ÍÊÇËü²¢Ã»ÓдòËãÈÃÈËÃÇΪÁËд³ÌÐò¶øÐ´³ÌÐò——ÈËÃÇÒ²ÐèÒª¿¼ÂdzÌÐòµÄÎĵµ»¯ÎÊÌâ¡£¶ÔÓÚ³ÌÐòµÄÎĵµ»¯£¬×î´óµÄÎÊÌâιýÓÚ¶ÔÎĵµµÄά»¤¡£ÈôÎĵµÓë´úÂë·ÖÀ룬ÄÇôÿ´Î¸Ä±ä´úÂëºó¶¼Òª¸Ä±äÎĵµ£¬ÕâÎÞÒÉ»á±ä³ÉÏ൱Âé·³µÄÒ»¼þÊÂÇé¡£½â¾öµÄ·½·¨¿´ÆðÀ´ËƺõºÜ¼òµ¥£º½«´úÂëͬÎĵµ“Á´½Ó&rd ......
¡¡¡¡ÄÇôҪ³ÉΪ¼Ü¹¹Ê¦µÄ;¾¶ËƺõÖ»ÓÐÏÖÔÚ½ÏΪÁ÷ÐеÄÈí¼þѧԺºÍ¸öÈË×ÔÎÒÅàÑøÁË¡£¹ØÓÚÈí¼þѧԺÎÒ½Ó´¥¹ý²»ÉÙ£¬Æä×ÚÖ¼¾ø´ó²¿·Ö¶¼ÊÇÔì¾Í(or´òÔì)ÆóÒµ ÐèÒªµÄÈí¼þ¼Ü¹¹Ê¦(or³ÌÐòÔ±orÈ˲Å)¡£½ÌʦÀ´Ô´ÓëÆóÒµ¡¢Ñ§Ô±À´Ô´ÓëÆóÒµ¡¢È˲ÅÊäË͵½ÆóÒµÊÇËûÃǰìѧµÄÊֶΡ£¾¡¹Ü¸÷¸öÈçÓêºó´ºËñ°ã³öÏÖµÄÈí¼þѧԺ¿ÚºÅ²î ²»¶à£¬µ«¿ÖÅ´ó¶àÖ»ÊÇΪÁËȦ ......
½â¾ö·½·¨Ò»:(×îÖØÒªµÄÒ»ÖÖ·½·¨)
Äã¿´ÏÂmy.ini£¬ÓÐÎÞ
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
È»ºó½¨Á¢±íʱ£¬Ò²ÒªÓ㨱ÈÈ磩
DROP TABLE IF EXISTS `Company`;
CREATE &nb ......
×é¼þ
¹¦ÄÜ
Com.guipei.listener. SessionListener
¼àÌý×é¼þ£¬Íê³ÉHttpSessionContextµÄ¹¦ÄÜ
index.jsp
ʵÏÖÓû§µÇ½£¬´´½¨ÐµÄsession
logout.jsp
ʵÏÖÓû§Í˳ö£¬Óû§×Ô¶¯É¾³ýsession
display.jsp
ÏÔʾÓû§µÇ½ÐÅÏ¢£¬ÔÚÓû§µÇ½ºó×Ô¶¯×ªÈë
session.jsp
Áгöµ±Ç°ËùÓеÄsession
kill.jsp
ɱµôÖ¸¶¨µÄ»á»° ......
Java Cglib
1.CGLIB°üµÄ½éÉÜ
´úÀíΪ¿ØÖÆÒª·ÃÎʵÄÄ¿±ê¶ÔÏóÌṩÁËÒ»ÖÖ;¾¶¡£µ±·ÃÎʶÔÏóʱ£¬ËüÒýÈëÁËÒ»¸ö¼ä½ÓµÄ²ã¡£JDK×Ô´Ó1.3°æ±¾¿ªÊ¼£¬¾ÍÒýÈëÁ˶¯Ì¬´úÀí£¬²¢ÇÒ¾³£±»ÓÃÀ´¶¯Ì¬µØ´´½¨´úÀí¡£JDKµÄ¶¯Ì¬´úÀíÓÃÆðÀ´·Ç³£¼òµ¥£¬µ±ËüÓÐÒ»¸öÏÞÖÆ£¬¾ÍÊÇʹÓö¯Ì¬´úÀíµÄ¶ÔÏó±ØÐëʵÏÖÒ»¸ö»ò¶à¸ö½Ó¿Ú¡£Èç¹ûÏë´úÀ ......