¼ÌÐø Âþ̸Java¼ÓÃܼ¼Êõ£¨Ò»£©
HMAC
HMAC£¨Hash Message Authentication Code£¬É¢ÁÐÏûÏ¢¼ø±ðÂ룬»ùÓÚÃÜÔ¿µÄHashËã·¨µÄÈÏÖ¤ÐÒé¡£ÏûÏ¢¼ø±ðÂëʵÏÖ¼ø±ðµÄÔÀíÊÇ£¬Óù«¿ªº¯ÊýºÍÃÜÔ¿²úÉúÒ»¸ö¹Ì¶¨³¤¶ÈµÄÖµ×÷ΪÈÏÖ¤±êʶ£¬ÓÃÕâ¸ö±êʶ¼ø±ðÏûÏ¢µÄÍêÕûÐÔ¡£Ê¹ÓÃÒ»¸öÃÜÔ¿Éú³ÉÒ»¸ö¹Ì¶¨´óСµÄСÊý¾Ý¿é£¬¼´MAC£¬²¢½«Æä¼ÓÈëµ½ÏûÏ¢ÖУ¬È»ºó´«Êä¡£½ÓÊÕ·½ÀûÓÃÓë·¢ËÍ·½¹²ÏíµÄÃÜÔ¿½øÐмø±ðÈÏÖ¤µÈ¡£
ͨ¹ýjava´úÂëʵÏÖÈçÏ£º
/** *//**
* ³õʼ»¯HMACÃÜÔ¿ http://www.guihua.org http://www.feng123.com
*
* @return
* @throws Exception
*/
public static String initMacKey() throws Exception {
KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC);
SecretKey secretKey = keyGenerator.generateKey();
return encryptBASE64(secretKey.getEncoded());
}
/** *//**
* HMAC¼ÓÃÜ
*
* @param data
* @param key
* @return
* @throws Exception
*/
public static byte[] encryptHMAC(byte[] data, String key) throws Exception {
SecretKey secretKey = new SecretKeySpec(decryptBASE64(key), KEY_MAC);
Mac mac = Mac.getInstance(secretKey.getAlgorithm());
mac.init(secretKey);
return mac.doFinal(data);
}
¸ø
Ïà¹ØÎĵµ£º
×î½ü¶ÁÍê<Java²¢·¢±à³Ìʵ¼ù>,ÎÞÒÉÕâÊÇÒ»±¾ºÃÊé,ËüʹµÃÎÒ¶ÔÏß³Ì,Ëø,ÒÔ¼°Óë²¢·¢Ïà¹ØµÄ
һЩ֪ʶÌåϵ¸ü¼ÓÍ걸,Ïл°²»¶à˵,ÏÂÃæÎÒϵͳÊáÀíÁËÏÂÀïÃæµÄһЩÀíÂÛÒªµã,ÏàÐÅʵ¼ùÉÏ
Ãæ,´ó¼Ò»ò¶à»òÉÙ¶¼»áÓÐÌå»á,ÄÇôÓÃÀíÂÛµÄ֪ʶµã½«Êµ¼ùÌå»áÁýÂçÆðÀ´,½«»áÐγɸü¼ÓÀιÌ
ºÍÍ걸µÄ֪ʶÌåϵ,ÖÁÉÙÎÒÕâôÈÏΪ,дÕâһƪ±Ê¼ÇÒ²ÊÇÓÃÒÔ ......
½ñÌìÒ»ÌìѧÁËÒì³£´¦ÀíÕâÒ»Õ¡£
Ê×ÏÈÒì³£ÊÇJava³ÌÐòÔÚÔËÐÐÆÚ³öÏֵĴíÎ󣬷DZàÒëÆÚ£¨javac£©³öÏֵĴíÎó¡£
È»ºóÔÙ¸øÒì³£·ÖÀ࣬Òì³£·ÖΪÈýÖÖ£¬µÚһΪerror£¬ÕâÖÖÒì³£²»¿ÉÒÔ´¦Àí£¬ÊÇϵͳµÄÄÚ²¿´íÎ󣬵ڶþΪException£¬ÕâÖÖ¿ÉÒÔ±»´¦Àí£¬ExceptionÀïÃæÓÖÓиöRuntimeExceptionµÄÀ࣬¶øRuntimeExceptionÓÖÊÇ¿ÉÒÔ²»±»²¶»ñ´¦ÀíµÄ£¬Òò ......
ǰһ¶Îʱ¼äΪ´ó¼ÒÍÆ¼öÁË»ù±¾Javaѧϰ¼Æ½Ï¾µäµÄÖÐÎÄͼÊ飬½ñÌìÔÙΪ´ó¼Ò½éÉܼ¸±¾£¬ÓÐÐËȤµÄÅóÓѲ»·ÁÒ»¿´¡£ JBuilder ¿ª·¢ÈËÔ±Ö¸ÄÏÔÊéÃû: Borland Jbuilder for Windows 95,Windows 98,&Wnidows NT Developer¡®s Guide £¬JBuilderÊÇBorland¹«Ë¾ËùÍÆ³öµÄJavaÓïÑÔ±à³Ì¹¤¾ß£¬Ëü¾ßÓÐÒ»¸ö¹¦ÄÜÇ¿´óµÄ¼¯³É¿ª·¢»·¾³£¬¿ÉÒÔ¿ìËÙ´´½¨¸÷Ö ......
1.1 °²×°JDK
1.1.1 ÏÂÔØJDK
´ò¿ªhttp://java.sun.com/ÍøÕ¾£¬ÔÚĿ¼ÀïÃæÑ¡ÔñDownload£¬ÔÚÏÂÀ²Ëµ¥ÖÐÑ¡ÔñJava SE
½øÈëÏÂÒ»¸öÒ³Ãæ£¬ÒªÑ¡ÔñÏÂÔØJDK£¬¶ø²»ÒªÏÂÔØJRE£º
½ÓÏÂÀ´ÊÇÑ¡ÔñÔËÐÐµÄÆ½Ì¨£¬ÕâÀﵱȻÊÇÑ¡ÔñlinuxÁË£º
Ñ¡ÔñºÃƽ̨ºó£¬µã»÷continue:
ÕâÀï¿ÉÒÔÖ±½Óµ ......
javaÊÔÌâ
http://202.201.112.11/jpk/apply/teacher/preface/53/test123/test3/exam.htm
1.½Ó¿ÚÖз½·¨µÄÇ°ÃæÓÐÄÄЩÐÞÊηû
·ÃÎÊȨÏÞ ·µ»ØÖµÀàÐÍ ÊÇ·ñ¾²Ì¬ ÊÇ·ñ³éÏó
2.ÒÔÏÂÄĸöÎªÕæ
Interger a = new Interger(9);
Interger b = new Interger(9);
Long c = New Long(9)
-----
&nbs ......