ITeye博客

2012 年文章归档

共 242 篇文章

常见证书格式和转换(转)

PKCS 全称是 Public-Key Cryptography Standards ,是由 RSA 实验室与其它安全系统开发商为促进公钥密码的发展而制订的一系列标准,PKCS 目前共发布过 15 个标准。 常用的有: PKCS#7 Cryptographic Message Syntax Standard PKCS#10 Certification Request Standard PKCS#12 Personal Information Exchange Syntax Standard X.509是常见通用的证书格式。所有的证书都符合为Public Key Infrastructure …

2012-10-25 11:04

JAVA:安全证书-公钥加密,私钥解密示例程序(转)

原址( http://blog.csdn.net/nimmy/article/details/5490990 ) 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; p…

2012-10-24 17:59

java 检查本地cer证书(转)

原址( http://blog.sina.com.cn/s/blog_4bea2fb101000a65.html ); import java.io.FileInputStream; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateFactory; import java.security.cert.CertificateNotYetValidException; import java.security.cert.X509Certificate; impo…

2012-10-24 17:57

https Connector SSL Support

http://tomcat.apache.org/tomcat-6.0-doc/config/http.html Attribute Description algorithm The certificate encoding algorithm to be used. This defaults to KeyManagerFactory.getDefaultAlgorithm() which returns SunX509 for Sun JVMs. IBM JVMs return IbmX509 . For other vendors, consult the JVM documenta…

2012-10-24 17:55

tomcat https入门(转)

在网上搜了一下,内容不是很完善。现进行整理,做个学习笔记,以备以后使用。 (1)进入到jdk下的bin目录 (2)输入如下指令“keytool -v -genkey -alias tomcat -keyalg RSA -keystore d:/tomcat.keystore” d:/tomcat.keystore是将生成的tomcat.keystore放到d盘根目录下。注意若要放到c盘,在win7系统下,需要以管理员身份进入到命令行中进行操作,否则是无法创建tomcat.keystore的。本例放到d盘下。 如何以管理员身份进入到命令行下呢?开始->搜索框中输入cmd->等待(注意不回车)-…

2012-10-24 17:13

tomcat https访问设置(转)

前几天客户提出要强制使用HTTPS方式访问Tomcat中的相关项目,于是研究了下,现将具体的步骤写下: 主要分2步:让tomcat能使用https--->强制使用https访问 1.让tomcat能使用https A.在运行命令JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore C:\Tomcat\GMAE3.0Tomcat\tomcat.keystore 这样就生成了证书,将证书放到合适的地方(任意地方都可以) B.打开tomcat目录下的server.xml文件并找到关于ssl的相关段 <!-- Define…

2012-10-23 10:02

简要说明下 关于单向认证和双向认证(转)

单向认证 :客户端向服务器发送消息,服务器接到消息后,用服务器端的密钥库中的私钥对数据进行加密,然后把加密后的数据和服务器端的公钥一起发送到 客户端,客户端用服务器发送来的公钥对数据解密,然后在用传到客户端的服务器公钥对数据加密传给服务器端,服务器用私钥对数据进行解密,这就完成了客户端 和服务器之间通信的安全问题,但是单向认证没有验证客户端的合法性。 双向认证 :客户端向服务器发送消息,首先把消息用客户端证书加密然后连同时把客户端证书一起发送到服务器端,服务器接到消息后用首先用客户端证书把 消息解密,然后用服务器私钥把消息加密,把服务器证书和消息一起发送到客户端,客户端用发来的服务器证书对消…

2012-10-22 17:15

JDK中keytool常用命令参数

JDK中keytool常用命令 -genkey 在用户主目录中创建一个默认文件".keystore",还会产生一个mykey的别名,mykey中包含用户的公钥、私钥和证书 -alias 产生别名 -keystore 指定密钥库的名称(产生的各类信息将不在.keystore文件中 -keyalg 指定密钥的算法 -validity 指定创建的证书有效期多少天 -keysize 指定密钥长度 -storepass 指定密钥库的密码 -keypass 指定别名条目的密码 -dname 指定证书拥有者信息 例如: "CN=sagely,OU=atr,O=szu,L=sz,ST=gd,C=cn" -l…

2012-10-22 11:53

google开源OCR项目之tesseract-ocr

google 的图片搜索就是拿这个做的啊 http://code.google.com/p/tesseract-ocr/ example http://blog.csdn.net/foamflower/article/details/6110211 http://blog.csdn.net/zhoushuyan/article/details/5948289#1567946

2012-10-19 15:35

oracle decode 的自我见解

select decode(1,2,3,11,4,15,11,14,19,17) tt from dual; if 1=2 then 3 elsif 1=11 then 4 elsif 1=15 then 11 elsif 1=14 then 19 elsif 1=17 then 17 endif; select decode(1,2,3,11,4,15,11,14,19,1,2,4) tt from dual; if 1=2 then 3 elsif 1=11 then 4 elsif 1=15 then 11 elsif 1=14 then 19 elsif 1=1 then 2 end…

2012-10-17 17:50

修改Tomcat Server name名称分享(转载)

1.修改tomcat服务器显示名 1) 编辑 D:\tomcat-6.0.0\bin\catalina.bat 文件 2) 找到这一段 if not "%OS%" == "Windows_NT" goto noTitle set _EXECJAVA=start "Tomcat" %_RUNJAVA% 修改 if not "%OS%" == "Windows_NT" goto noTitle set _EXECJAVA=start "Tomcat_other" %_RUNJAVA% 2.修改Tomcat Server name名称 在tomcat/lib/tomcat-coyote.jar中 …

2012-10-11 10:58

Tomcat 服务器server.xml,web.xml的关键参数配置(转载)

Tomcat 服务器server.xml的关键参数配置 说明:以下文字均以tomcat5.0.30为例进行。 1,配置tomcat服务器访问端口,只需配置Connector的port端口即可。Tomcat默认为8080,现修改port参数值为80。 <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --> <Connector port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirec…

2012-10-11 10:34

jdom解决中文乱码问题 JAVA生成xml文件

package com.sinosoft.jbs.sevices.sinolifelast.test; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import org.jdom.Attribute; import org.jdom.Document; import org.jdom.Element; import org.jdom.output.XMLOutputter; public class CreateXML { public void…

2012-10-10 12:13

oracle dblink的格式

-- Drop existing database link drop database link uy_DBLINK; -- Create database link create database link uy_DBLINK connect to uy using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.108)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )'; java中调用orcl的的存储过程 …

2012-10-08 11:43

模仿iteye代码高亮显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <title>我的代码收藏 - 我的应用 - ITeye.com…

2012-09-27 20:38

CSS3 support for Internet Explorer 6, 7, and 8

主要是在css中导入这个文件ie-css3.htc behavior: url(ie-css3.htc); 导入这个文件事需要服务器的支持,不然在ie中报 Access is denied to: file:///C:/Users/Administrator/Desktop/aa/ie-css3.htc 就是拒绝访问 效果 事例 <!DOCTYPE html> <html lang="en"> <head> <title>CSS3 support in Internet Explorer 6, 7, and 8</title> <style type="text/css"> /* The s…

2012-09-21 16:47

Komodo Edit 7的正则表达式的使用

//替换前 ACTIVITYID SERVICEID NAME ACTIVITYTYPE KEYFLAG RETURNDOC //ctrl+h调用Find对话框 Find what:(\w+) Replace with: p_nt_operareconlist(i).\1:=cur.\1; //替换后 p_nt_operareconlist(i).ACTIVITYID:=cur.ACTIVITYID p_nt_operareconlist(i).SERVICEID:=cur.SERVICEID p_nt_operareconlist(i).NAME:=cur.NAME p_nt_operar…

2012-09-20 15:04

解决js window resize为什么会执行两次

//让 onresize 事件只执行一次,默认两次,稍作修改。。。 var resizeTimer = null; window.onresize = function(){ resizeTimer = resizeTimer ? null : setTimeout(doResize,0); } function doResize(){ alert('resize'); } 转载之 http://henry8088.iteye.com/blog/738778

2012-09-14 21:19

Gritter demo for jQuery for boedesign

红色的部分是增加的,因为这是我的需求,不过可以根据自己的需求定制自己的boedesign html部分 官网 http://www.boedesign.com/ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Gritter demo for jQuery - boedesign.co…

2012-09-14 20:28

jaxb的marshal和unmarshall使用

marshal /** * 对象转xml * 返回xml * @param tXLife * @return */ public static String tXLiftToXML(com.TXLife tXLife){ String xml=""; try { ByteArrayOutputStream out = new ByteArrayOutputStream(); JAXBContext jc = JAXBContext .newInstance("com"); //包的命名空间 Marshaller m = null; synchronized (jc) { m = jc.cre…

2012-09-14 16:31