⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java

📁 有关mysql文章教程,本人收集的一些有关mysql文章教程
💻
字号:







<!--publish html Time 2005年02月25日 09:51-->
<html>
<head>
<title>java常用的加密,解密,数字签名等API__ZhangLiHai.Com_技术文章</title>
<meta NAME="Keywords" CONTENT="java常用的加密,解密,数字签名等API,java常用的加密,解密,数字签名等API" >
<meta NAME="Description" CONTENT="张利海的个人网站,提供 刘德华,华仔,张利海,阿列,华仔歌迷,blog,java,javascript,php,jsp,servlet,技术文章,lucene,略缩图,图片合成,cache,搜索,相册,blog,Swing,MySql,XML,XMLHTTP,Socket,JDBC,线程,全文检索,FindBugs,文件类型,php模板,附加码,Struts,hibernate,乱码,中文问题" >
<meta NAME="ROBOTS" CONTENT="all">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://www.zhanglihai.com/css/article.css" type="text/css">
<style>
a.m:visited {text-decoration:none;color:#666666;font-size:9pt;}
a.m:hover {text-decoration:none;color:#ff9900;font-size:9pt;}
a.m:link {text-decoration:none;color:#666666;font-size:9pt;}
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h1><a href="http://www.zhanglihai.com/" class="title" title="回到首页">ZhangLiHai.Com Blog</a></h1>
<table width="750" border="0" cellspacing="1" cellpadding="1" align="center">
  <tr> 
    <td width="750"> 
      <table width="98%" border="0" cellspacing="1" cellpadding="1">
        <tr> 
          <td> 
            <h3>java常用的加密,解密,数字签名等API</h3>
          </td>
        </tr>
        <tr> 
          <td height="5"></td>
        </tr>
        <tr> 
          <td><span class="date">张利海 于 2005年02月25日 09:51 发表</span> </td>
        </tr>
        <tr>
          <td>关键词 : java常用的加密,解密,数字签名等API</td>
        </tr>
        <tr> 
          <td> 
            <p>摘自:<A href="http://dev.csdn.net/article/63306.shtm" target=_blank>http://dev.csdn.net/article/63306.shtm</A><BR><BR><BR><DIV><FONT color=#003333><STRONG><FONT color=#ff0000>常用API</FONT></STRONG></FONT><P><FONT color=#003333>java.security.KeyPairGenerator 密钥生成器类<BR>public static KeyPairGenerator getInstance(String algorithm) throws NoSuchAlgorithmException<BR>以指定的算法返回一个KeyPairGenerator 对象<BR>参数: algorithm 算法名.如:"DSA","RSA"</FONT></P><P><FONT color=#003333>public void initialize(int keysize)<BR></FONT></P><P><FONT color=#003333>以指定的长度初始化KeyPairGenerator对象,如果没有初始化系统以1024长度默认设置<BR></FONT></P><P><FONT color=#003333>参数:keysize 算法位长.其范围必须在 512 到 1024 之间,且必须为 64 的倍数</FONT></P><P><FONT color=#003333>public void initialize(int keysize, SecureRandom random)<BR>以指定的长度初始化和随机发生器初始化KeyPairGenerator对象<BR>参数:keysize 算法位长.其范围必须在 512 到 1024 之间,且必须为 64 的倍数<BR>random 一个随机位的来源(对于initialize(int keysize)使用了默认随机器</FONT></P><P><FONT color=#003333>public abstract KeyPair generateKeyPair()<BR>产生新密钥对</FONT></P><P><FONT color=#003333>java.security.KeyPair 密钥对类<BR>public PrivateKey getPrivate()<BR>返回私钥</FONT></P><P><FONT color=#003333>public PublicKey getPublic()<BR>返回公钥</FONT></P><P><FONT color=#003333>java.security.Signature 签名类<BR>public static Signature getInstance(String algorithm) throws NoSuchAlgorithmException<BR>返回一个指定算法的Signature对象<BR>参数 algorithm 如:"DSA"</FONT></P><P><FONT color=#003333>public final void initSign(PrivateKey privateKey)<BR>throws InvalidKeyException<BR>用指定的私钥初始化<BR>参数:privateKey 所进行签名时用的私钥</FONT></P><P><FONT color=#003333>public final void update(byte data)<BR>throws SignatureException<BR>public final void update(byte[] data)<BR>throws SignatureException<BR>public final void update(byte[] data, int off, int len)<BR>throws SignatureException<BR>添加要签名的信息</FONT></P><P><FONT color=#003333>public final byte[] sign()<BR>throws SignatureException<BR>返回签名的数组,前提是initSign和update</FONT></P><P><FONT color=#003333>public final void initVerify(PublicKey publicKey)<BR>throws InvalidKeyException<BR>用指定的公钥初始化<BR>参数:publicKey 验证时用的公钥</FONT></P><P><FONT color=#003333>public final boolean verify(byte[] signature)<BR>throws SignatureException<BR>验证签名是否有效,前提是已经initVerify初始化<BR>参数: signature 签名数组<BR><BR><BR></FONT></P></DIV></p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
  <td >	
  <script language="JavaScript">
	var url = location.href;
	document.write("原文出处:"+url);
</script>
<br>
<script type="text/javascript"><!--
google_ad_client = "pub-9146239964040731";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_ad_type = "text";
google_color_border = "000000";
google_color_bg = "F0F0F0";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
  </tr>
</table>
<table width="750" border="0" cellspacing="1" cellpadding="1" align="center">
  <tr>
    <td bgcolor="#EFEFEF">相关连接&nbsp;&nbsp;<a href="/article/rss/detail/UA260BW03G2EG042RR00GCW1804A9SBT.xtp" target="_blank"><img src="/images/rss20_logo.gif" width="80" height="15" border="0"/></a></td>
  </tr>
  <tr>
    <td>
	<!--相关文章开始-->
	 <p><nobr> <a href="http://www.zhanglihai.com/article/2005-02-25/UA260BW03G2EG042RR00GCW1804A9SBT.xtp" target="_blank"><u>java常用的加密</u>,<u>解密</u>,<u>数字签名等API</u></a>(100.0%)</nobr> <br/>摘自:&lt;A href=&quot;...FONT color=#ff0000&gt;<u>常用API</u>&lt;/FONT&gt;&lt;/...FONT color=#003333&gt;<u>java</u>.security....FONT color=#003333&gt;<u>java</u>.security.KeyPair 密钥对类&...FONT color=#003333&gt;<u>java</u>.security.Signature <u>签名</u>类&lt;BR&gt;public ...BR&gt;参数:privateKey 所进行<u>签名</u></font><b>...</b><br> <nobr> <font class="green">http://www.zhanglihai.com/article/2005-02-25/UA260BW03G2EG042RR00GCW1804A9SBT.xtp-[2005年02月25日 09:51]</font> <font class="gray">作者:张利海</font></nobr></p> 
	<!--相关文章结束-->
	</td>
  </tr>
  <tr>
    <td bgcolor="#EFEFEF" align="right"><a href="http://www.zhanglihai.com:8080/search.java?start=0&num=5&ie=UTF-8&order=date&q=java常用的加密,解密,数字签名等API" target="_blank">更多&gt;&gt;</td>
  </tr>  
</table>
<table width="750" border="0" cellspacing="1" cellpadding="1" align="center">
  <tr>
    <td><br>
      <br>
<script language="JavaScript" src="http://www.zhanglihai.com/js/footer.js"></script>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -