Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
RSAPrivateKey.java
Package: security.rar [view]
Upload User: lior1029
Upload Date: 2013-05-07
Package Size: 209k
Code Size: 2k
Category:
CA program
Development Platform:
Java
- package org.infosecurity.cryptography;
- /**
- * <p>Title: RSA的私钥类 </p>
- * <p>Description: RSA的私钥类 </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: 中信信息安全组织(CISO)</p>
- * @author 张荣华
- * @version 1.0.2003.0704
- */
- import java.math.BigInteger;
- import java.security.SecureRandom;
- import org.bouncycastle.asn1.*;
- import org.bouncycastle.asn1.pkcs.*;
- public class RSAPrivateKey extends RSAPublicKey{
- private BigInteger d;
- private BigInteger p;
- private BigInteger q;
- private BigInteger dP;
- private BigInteger dQ;
- private BigInteger qInv;
- /**
- *
- */
- public RSAPrivateKey(
- BigInteger modulus,
- BigInteger publicExponent,
- BigInteger privateExponent,
- BigInteger p,
- BigInteger q,
- BigInteger dP,
- BigInteger dQ,
- BigInteger qInv)
- {
- super(modulus,publicExponent);
- this.d = privateExponent;
- this.p = p;
- this.q = q;
- this.dP = dP;
- this.dQ = dQ;
- this.qInv = qInv;
- }
- public BigInteger getPrivateExponent()
- {
- return d;
- }
- public BigInteger getPublicExponent()
- {
- return super.getExponent();
- }
- public BigInteger getModulus()
- {
- return super.getModulus();
- }
- public BigInteger getP()
- {
- return p;
- }
- public BigInteger getQ()
- {
- return q;
- }
- public BigInteger getDP()
- {
- return dP;
- }
- public BigInteger getDQ()
- {
- return dQ;
- }
- public BigInteger getQInv()
- {
- return qInv;
- }
- /**
- * 进行DER编码
- * @author 张荣华
- */
- public DERObject getDERObject()
- {
- ASN1EncodableVector v = new ASN1EncodableVector();
- v.add(new DERInteger(0)); /* 版本为0 */
- v.add(new DERInteger(getModulus()));
- v.add(new DERInteger(getPublicExponent()));
- v.add(new DERInteger(getPrivateExponent()));
- v.add(new DERInteger(getP()));
- v.add(new DERInteger(getQ()));
- v.add(new DERInteger(getDP()));
- v.add(new DERInteger(getQInv()));
- v.add(new DERInteger(getQInv()));
- return new DERSequence(v);
- }
- }