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³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢Java±à³ÌÈëÃÅÀà
¶ÔÓÚûÓÐJava±à³Ì¾ÑéµÄJava³ÌÐòÔ±ÒªÈëÃÅ£¬Ëæ±ã¶ÁʲôÈëÃÅÊé¼®¶¼Ò» ......
°æȨËùÓУ¬×ªÔØ×¢Ã÷³ö´¦£¡
תÔØÇëЯ´ø´ËÐÅÏ¢£ºhuangfox
-----------------------------------------------------------------
³éÏ󹤳§ºÍ¹¤³§·½·¨ ¸Õ¿ªÊ¼ºÜÈÝÒ×»ìÏý£¬ÖÁÉÙÎÒÊÇÕâÑùµÄ£¡
²»¹ýËûÃDzúÉúµÄÔµÓÉÀ´¿´£¬»¹ÊÇ¿ÉÒԺúÃÇø·ÖµÄ¡£
1.¹¤³§·½·¨£ºÊÇΪÁ˱ÜÃâÓ¦ÓÃÖ±½ÓʵÀýÀà²ã´Î½á¹¹ÖеľßÌåÀ࣬Ìṩһ¸ö·½·¨¸ù¾ÝÔËÐÐÇé ......
1. J2EEÊǹ淶£¬ÊÇÒ»ÖÖJSR±ê×¼£¬ÓÐÏêϸÎĵµ£¬²ûÊöJ2EEÌṩÄÄЩ¹¦ÄÜ£¬¿ÉÒÔÏÂÔØÕâÑùÎĵµ£¬µ±È»»¹ÓÐһЩ´úÂë½Ó¿Ú£¬ÕâÊǵäÐÍJavaÊÀ½çÖеĿò¼Ü´úÂë+±ê×¼ÎĵµÐÎʽ£¬ÕâÊÇÖ»ÓÐ×ÔÓÉÊÀ½ç²ÅÓеĹ淶£¬ÔÚ΢ÈíMSÊÀ½çÄãÊǾø¶Ô²»»á¿´µ½µÄ£¬ËùÒÔ£¬´Ó΢Èíת¹ýÀ´µÄ£¬»áÔΣ¬»á²»ÊÊÓ¦£¬²»ÄÜÔÙ°´ÕÕËûÃÇÒÔÇ°µÄ¾ÑéÀ´¿´´ý×ÔÓɵÄÐÂÊÀ½ç¡£
2.¼Ü¹¹ÊǾ ......
½â¾ö·½·¨Ò»:(×îÖØÒªµÄÒ»ÖÖ·½·¨)
Äã¿´ÏÂmy.ini£¬ÓÐÎÞ
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
È»ºó½¨Á¢±íʱ£¬Ò²ÒªÓ㨱ÈÈ磩
DROP TABLE IF EXISTS `Company`;
CREATE &nb ......
Java ByteCode
1£¬Ê²Ã´ÊÇBytecode
C/C++±àÒëÆ÷°ÑÔ´´úÂë±àÒë³É»ã±à´úÂ룬Java±àÒëÆ÷°ÑJavaÔ´´úÂë±àÒë³É×Ö½ÚÂëbytecode¡£
Java¿çƽ̨Æäʵ¾ÍÊÇ»ùÓÚÏàͬµÄbytecode¹æ·¶×ö²»Í¬Æ½Ì¨µÄÐéÄâ»ú£¬ÎÒÃǵÄJava³ÌÐò±àÒë³Ébytecodeºó¾Í¿ÉÒÔÔÚ²»Í¬Æ½Ì¨ÅÜÁË¡£
.net¿ò¼ÜÓÐIL(intermediate language)£¬»ã±àÊÇC/C++³ÌÐòµÄÖмä±í´ï·½Ê½£¬ ......