- 浏览: 2551650 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
bouncycastle(8)Learn from others ECC/KeyTool
ECC (Elliptic Curves Cryptography)
It is not supported by JDK from the content of other's blog. So I do not take time to verify the codes.
Work with KeyTool in JDK
prepare the key pair first
>keytool -genkey -validity 36000 -alias www.sillycat.com -keyalg RSA -keystore /Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore
-genkey means generate the key
-validity means the valid date, 36000 means 36000 days.
-alias means the name
-keyalg algorithm
-keystore where do we store the key pair
>keytool -export -keystore /Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore -alias www.sillycat.com -file /Users/karl/work/easy/easycastle/src/main/resources/sillycat.cer -rfc
-export
-keystore identify the key store file
-alias
-file where do we store the car file.
-rfc means output to txt based on base64
sillycat.keystore holds the private key, sillycat.cer holds the public key.
The implementation will be as follow.
package com.sillycat.easycastle.encryption;
import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Date;
import javax.crypto.Cipher;
publicabstractclass CertificateCoder extends Coder {
/**
* (Java Key Store,JKS)KEY_STORE
*/
publicstaticfinal String KEY_STORE = "JKS";
publicstaticfinal String X509 = "X.509";
/**
* get the private key from keystore
*
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
privatestatic PrivateKey getPrivateKey(String keyStorePath, String alias,
String password) throws Exception {
KeyStore ks = getKeyStore(keyStorePath, password);
PrivateKey key = (PrivateKey) ks.getKey(alias, password.toCharArray());
return key;
}
/**
* get the public key from certificate
*
* @param certificatePath
* @return
* @throws Exception
*/
privatestatic PublicKey getPublicKey(String certificatePath)
throws Exception {
Certificate certificate = getCertificate(certificatePath);
PublicKey key = certificate.getPublicKey();
return key;
}
privatestatic Certificate getCertificate(String certificatePath)
throws Exception {
FileInputStream in = null;
Certificate certificate = null;
CertificateFactory certificateFactory = CertificateFactory
.getInstance(X509);
in = new FileInputStream(certificatePath);
certificate = certificateFactory.generateCertificate(in);
in.close();
return certificate;
}
privatestatic Certificate getCertificate(String keyStorePath,
String alias, String password) throws Exception {
KeyStore ks = getKeyStore(keyStorePath, password);
Certificate certificate = ks.getCertificate(alias);
return certificate;
}
privatestatic KeyStore getKeyStore(String keyStorePath, String password)
throws Exception {
FileInputStream is = new FileInputStream(keyStorePath);
KeyStore ks = KeyStore.getInstance(KEY_STORE);
ks.load(is, password.toCharArray());
is.close();
return ks;
}
/**
* encrypt the data using private key
*
* @param data
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstaticbyte[] encryptByPrivateKey(byte[] data, String keyStorePath,
String alias, String password) throws Exception {
// get private key
PrivateKey privateKey = getPrivateKey(keyStorePath, alias, password);
// encrypt the data
Cipher cipher = Cipher.getInstance(privateKey.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
return cipher.doFinal(data);
}
/**
* decrypt the data using private key
*
* @param data
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstaticbyte[] decryptByPrivateKey(byte[] data, String keyStorePath,
String alias, String password) throws Exception {
// get the private key
PrivateKey privateKey = getPrivateKey(keyStorePath, alias, password);
// decrypt the data
Cipher cipher = Cipher.getInstance(privateKey.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, privateKey);
return cipher.doFinal(data);
}
/**
* encrypt data based on public key
* @param data
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticbyte[] encryptByPublicKey(byte[] data, String certificatePath)
throws Exception {
// get the public key
PublicKey publicKey = getPublicKey(certificatePath);
// encrypt the data
Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
return cipher.doFinal(data);
}
/**
* decrypt data based on public key
* @param data
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticbyte[] decryptByPublicKey(byte[] data, String certificatePath)
throws Exception {
// get the public key
PublicKey publicKey = getPublicKey(certificatePath);
// decrypt data
Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, publicKey);
return cipher.doFinal(data);
}
/**
* verify Certificate
* @param certificatePath
* @return
*/
publicstaticboolean verifyCertificate(String certificatePath) {
return verifyCertificate(new Date(), certificatePath);
}
/**
* verify Certificate valid
* @param date
* @param certificatePath
* @return
*/
publicstaticboolean verifyCertificate(Date date, String certificatePath) {
boolean status = true;
try {
// get the certificate
Certificate certificate = getCertificate(certificatePath);
status = verifyCertificate(date, certificate);
} catch (Exception e) {
status = false;
}
return status;
}
privatestaticboolean verifyCertificate(Date date, Certificate certificate) {
boolean status = true;
try {
X509Certificate x509Certificate = (X509Certificate) certificate;
x509Certificate.checkValidity(date);
} catch (Exception e) {
status = false;
}
return status;
}
/**
* signature
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstatic String sign(byte[] sign, String keyStorePath, String alias,
String password) throws Exception {
X509Certificate x509Certificate = (X509Certificate) getCertificate(
keyStorePath, alias, password);
KeyStore ks = getKeyStore(keyStorePath, password);
//get private key
PrivateKey privateKey = (PrivateKey) ks.getKey(alias,
password.toCharArray());
//generate signature object
Signature signature = Signature.getInstance(x509Certificate
.getSigAlgName());
signature.initSign(privateKey);
signature.update(sign);
return encryptBASE64(signature.sign());
}
/**
* verify the signature
* @param data
* @param sign
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticboolean verify(byte[] data, String sign,
String certificatePath) throws Exception {
X509Certificate x509Certificate = (X509Certificate) getCertificate(certificatePath);
//get public key
PublicKey publicKey = x509Certificate.getPublicKey();
//generate signature
Signature signature = Signature.getInstance(x509Certificate
.getSigAlgName());
signature.initVerify(publicKey);
signature.update(data);
return signature.verify(decryptBASE64(sign));
}
/**
* verify keystore
* @param keyStorePath
* @param alias
* @param password
* @return
*/
publicstaticboolean verifyCertificate(Date date, String keyStorePath,
String alias, String password) {
boolean status = true;
try {
Certificate certificate = getCertificate(keyStorePath, alias,
password);
status = verifyCertificate(date, certificate);
} catch (Exception e) {
status = false;
}
return status;
}
/**
* verify key store
* @param keyStorePath
* @param alias
* @param password
* @return
*/
publicstaticboolean verifyCertificate(String keyStorePath, String alias,
String password) {
return verifyCertificate(new Date(), keyStorePath, alias, password);
}
}
The test case will be as follow:
package com.sillycat.easycastle.encryption;
importstatic org.junit.Assert.assertArrayEquals;
importstatic org.junit.Assert.assertEquals;
importstatic org.junit.Assert.assertTrue;
import org.junit.Test;
publicclass CertificateCoderTest {
private String password = "123456";
private String alias = "www.sillycat.com";
private String certificatePath = "/Users/karl/work/easy/easycastle/src/main/resources/sillycat.cer";
private String keyStorePath = "/Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore";
@Test
publicvoid testPublic2Private() throws Exception {
System.out.println("\npublic key encrypt——private key decrypt\n");
String inputStr = "A new world will come at the end.";
byte[] data = inputStr.getBytes();
byte[] encrypt = CertificateCoder.encryptByPublicKey(data,
certificatePath);
byte[] decrypt = CertificateCoder.decryptByPrivateKey(encrypt,
keyStorePath, alias, password);
String outputStr = new String(decrypt);
String encryptStr = new String(encrypt);
System.out.println("data: " + inputStr);
System.out.println("decryption: " + outputStr);
System.out.println("encryption: " + encryptStr);
assertArrayEquals(data, decrypt);
// verify the cer file
assertTrue(CertificateCoder.verifyCertificate(certificatePath));
}
@Test
publicvoid testPrivate2Public() throws Exception {
System.out.println("\nprivate encryption——public decryption\n");
String inputStr = "what is the status?";
byte[] data = inputStr.getBytes();
byte[] encodedData = CertificateCoder.encryptByPrivateKey(data,
keyStorePath, alias, password);
byte[] decodedData = CertificateCoder.decryptByPublicKey(encodedData,
certificatePath);
String outputStr = new String(decodedData);
String encryptStr = new String(encodedData);
System.out.println("data: " + inputStr);
System.out.println("decryption: " + outputStr);
System.out.println("encryption: " + encryptStr);
assertEquals(inputStr, outputStr);
}
@Test
publicvoid testSign() throws Exception {
System.out.println("\nprivate sign——public verify signature\n");
String data = "It is rainy out side.";
// generate the sign
String sign = CertificateCoder.sign(data.getBytes(), keyStorePath, alias,
password);
System.out.println("signature:\r" + sign);
// verification
boolean status = CertificateCoder.verify(data.getBytes(), sign,
certificatePath);
System.out.println("status:\r" + status);
assertTrue(status);
}
}
references:
http://snowolf.iteye.com/blog/383412
http://snowolf.iteye.com/blog/391931
http://snowolf.iteye.com/blog/397693
http://snowolf.iteye.com/blog/398198
ECC (Elliptic Curves Cryptography)
It is not supported by JDK from the content of other's blog. So I do not take time to verify the codes.
Work with KeyTool in JDK
prepare the key pair first
>keytool -genkey -validity 36000 -alias www.sillycat.com -keyalg RSA -keystore /Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore
-genkey means generate the key
-validity means the valid date, 36000 means 36000 days.
-alias means the name
-keyalg algorithm
-keystore where do we store the key pair
>keytool -export -keystore /Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore -alias www.sillycat.com -file /Users/karl/work/easy/easycastle/src/main/resources/sillycat.cer -rfc
-export
-keystore identify the key store file
-alias
-file where do we store the car file.
-rfc means output to txt based on base64
sillycat.keystore holds the private key, sillycat.cer holds the public key.
The implementation will be as follow.
package com.sillycat.easycastle.encryption;
import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Date;
import javax.crypto.Cipher;
publicabstractclass CertificateCoder extends Coder {
/**
* (Java Key Store,JKS)KEY_STORE
*/
publicstaticfinal String KEY_STORE = "JKS";
publicstaticfinal String X509 = "X.509";
/**
* get the private key from keystore
*
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
privatestatic PrivateKey getPrivateKey(String keyStorePath, String alias,
String password) throws Exception {
KeyStore ks = getKeyStore(keyStorePath, password);
PrivateKey key = (PrivateKey) ks.getKey(alias, password.toCharArray());
return key;
}
/**
* get the public key from certificate
*
* @param certificatePath
* @return
* @throws Exception
*/
privatestatic PublicKey getPublicKey(String certificatePath)
throws Exception {
Certificate certificate = getCertificate(certificatePath);
PublicKey key = certificate.getPublicKey();
return key;
}
privatestatic Certificate getCertificate(String certificatePath)
throws Exception {
FileInputStream in = null;
Certificate certificate = null;
CertificateFactory certificateFactory = CertificateFactory
.getInstance(X509);
in = new FileInputStream(certificatePath);
certificate = certificateFactory.generateCertificate(in);
in.close();
return certificate;
}
privatestatic Certificate getCertificate(String keyStorePath,
String alias, String password) throws Exception {
KeyStore ks = getKeyStore(keyStorePath, password);
Certificate certificate = ks.getCertificate(alias);
return certificate;
}
privatestatic KeyStore getKeyStore(String keyStorePath, String password)
throws Exception {
FileInputStream is = new FileInputStream(keyStorePath);
KeyStore ks = KeyStore.getInstance(KEY_STORE);
ks.load(is, password.toCharArray());
is.close();
return ks;
}
/**
* encrypt the data using private key
*
* @param data
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstaticbyte[] encryptByPrivateKey(byte[] data, String keyStorePath,
String alias, String password) throws Exception {
// get private key
PrivateKey privateKey = getPrivateKey(keyStorePath, alias, password);
// encrypt the data
Cipher cipher = Cipher.getInstance(privateKey.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
return cipher.doFinal(data);
}
/**
* decrypt the data using private key
*
* @param data
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstaticbyte[] decryptByPrivateKey(byte[] data, String keyStorePath,
String alias, String password) throws Exception {
// get the private key
PrivateKey privateKey = getPrivateKey(keyStorePath, alias, password);
// decrypt the data
Cipher cipher = Cipher.getInstance(privateKey.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, privateKey);
return cipher.doFinal(data);
}
/**
* encrypt data based on public key
* @param data
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticbyte[] encryptByPublicKey(byte[] data, String certificatePath)
throws Exception {
// get the public key
PublicKey publicKey = getPublicKey(certificatePath);
// encrypt the data
Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
return cipher.doFinal(data);
}
/**
* decrypt data based on public key
* @param data
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticbyte[] decryptByPublicKey(byte[] data, String certificatePath)
throws Exception {
// get the public key
PublicKey publicKey = getPublicKey(certificatePath);
// decrypt data
Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, publicKey);
return cipher.doFinal(data);
}
/**
* verify Certificate
* @param certificatePath
* @return
*/
publicstaticboolean verifyCertificate(String certificatePath) {
return verifyCertificate(new Date(), certificatePath);
}
/**
* verify Certificate valid
* @param date
* @param certificatePath
* @return
*/
publicstaticboolean verifyCertificate(Date date, String certificatePath) {
boolean status = true;
try {
// get the certificate
Certificate certificate = getCertificate(certificatePath);
status = verifyCertificate(date, certificate);
} catch (Exception e) {
status = false;
}
return status;
}
privatestaticboolean verifyCertificate(Date date, Certificate certificate) {
boolean status = true;
try {
X509Certificate x509Certificate = (X509Certificate) certificate;
x509Certificate.checkValidity(date);
} catch (Exception e) {
status = false;
}
return status;
}
/**
* signature
* @param keyStorePath
* @param alias
* @param password
* @return
* @throws Exception
*/
publicstatic String sign(byte[] sign, String keyStorePath, String alias,
String password) throws Exception {
X509Certificate x509Certificate = (X509Certificate) getCertificate(
keyStorePath, alias, password);
KeyStore ks = getKeyStore(keyStorePath, password);
//get private key
PrivateKey privateKey = (PrivateKey) ks.getKey(alias,
password.toCharArray());
//generate signature object
Signature signature = Signature.getInstance(x509Certificate
.getSigAlgName());
signature.initSign(privateKey);
signature.update(sign);
return encryptBASE64(signature.sign());
}
/**
* verify the signature
* @param data
* @param sign
* @param certificatePath
* @return
* @throws Exception
*/
publicstaticboolean verify(byte[] data, String sign,
String certificatePath) throws Exception {
X509Certificate x509Certificate = (X509Certificate) getCertificate(certificatePath);
//get public key
PublicKey publicKey = x509Certificate.getPublicKey();
//generate signature
Signature signature = Signature.getInstance(x509Certificate
.getSigAlgName());
signature.initVerify(publicKey);
signature.update(data);
return signature.verify(decryptBASE64(sign));
}
/**
* verify keystore
* @param keyStorePath
* @param alias
* @param password
* @return
*/
publicstaticboolean verifyCertificate(Date date, String keyStorePath,
String alias, String password) {
boolean status = true;
try {
Certificate certificate = getCertificate(keyStorePath, alias,
password);
status = verifyCertificate(date, certificate);
} catch (Exception e) {
status = false;
}
return status;
}
/**
* verify key store
* @param keyStorePath
* @param alias
* @param password
* @return
*/
publicstaticboolean verifyCertificate(String keyStorePath, String alias,
String password) {
return verifyCertificate(new Date(), keyStorePath, alias, password);
}
}
The test case will be as follow:
package com.sillycat.easycastle.encryption;
importstatic org.junit.Assert.assertArrayEquals;
importstatic org.junit.Assert.assertEquals;
importstatic org.junit.Assert.assertTrue;
import org.junit.Test;
publicclass CertificateCoderTest {
private String password = "123456";
private String alias = "www.sillycat.com";
private String certificatePath = "/Users/karl/work/easy/easycastle/src/main/resources/sillycat.cer";
private String keyStorePath = "/Users/karl/work/easy/easycastle/src/main/resources/sillycat.keystore";
@Test
publicvoid testPublic2Private() throws Exception {
System.out.println("\npublic key encrypt——private key decrypt\n");
String inputStr = "A new world will come at the end.";
byte[] data = inputStr.getBytes();
byte[] encrypt = CertificateCoder.encryptByPublicKey(data,
certificatePath);
byte[] decrypt = CertificateCoder.decryptByPrivateKey(encrypt,
keyStorePath, alias, password);
String outputStr = new String(decrypt);
String encryptStr = new String(encrypt);
System.out.println("data: " + inputStr);
System.out.println("decryption: " + outputStr);
System.out.println("encryption: " + encryptStr);
assertArrayEquals(data, decrypt);
// verify the cer file
assertTrue(CertificateCoder.verifyCertificate(certificatePath));
}
@Test
publicvoid testPrivate2Public() throws Exception {
System.out.println("\nprivate encryption——public decryption\n");
String inputStr = "what is the status?";
byte[] data = inputStr.getBytes();
byte[] encodedData = CertificateCoder.encryptByPrivateKey(data,
keyStorePath, alias, password);
byte[] decodedData = CertificateCoder.decryptByPublicKey(encodedData,
certificatePath);
String outputStr = new String(decodedData);
String encryptStr = new String(encodedData);
System.out.println("data: " + inputStr);
System.out.println("decryption: " + outputStr);
System.out.println("encryption: " + encryptStr);
assertEquals(inputStr, outputStr);
}
@Test
publicvoid testSign() throws Exception {
System.out.println("\nprivate sign——public verify signature\n");
String data = "It is rainy out side.";
// generate the sign
String sign = CertificateCoder.sign(data.getBytes(), keyStorePath, alias,
password);
System.out.println("signature:\r" + sign);
// verification
boolean status = CertificateCoder.verify(data.getBytes(), sign,
certificatePath);
System.out.println("status:\r" + status);
assertTrue(status);
}
}
references:
http://snowolf.iteye.com/blog/383412
http://snowolf.iteye.com/blog/391931
http://snowolf.iteye.com/blog/397693
http://snowolf.iteye.com/blog/398198
发表评论
-
Update Site will come soon
2021-06-02 04:10 1677I am still keep notes my tech n ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 430Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 435Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 374Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 455VPN Server 2020(2)Docker on Cen ... -
Nginx Deal with OPTIONS in HTTP Protocol
2020-02-15 01:33 356Nginx Deal with OPTIONS in HTTP ... -
PDF to HTML 2020(1)pdftohtml Linux tool or PDFBox
2020-01-29 07:37 405PDF to HTML 2020(1)pdftohtml Li ... -
Elasticsearch Cluster 2019(2)Kibana Issue or Upgrade
2020-01-12 03:25 720Elasticsearch Cluster 2019(2)Ki ... -
Spark Streaming 2020(1)Investigation
2020-01-08 07:19 295Spark Streaming 2020(1)Investig ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 294Hadoop Docker 2019 Version 3.2. ... -
MongoDB 2019(3)Security and Auth
2019-11-16 06:48 241MongoDB 2019(3)Security and Aut ... -
MongoDB 2019(1)Install 4.2.1 Single and Cluster
2019-11-11 05:07 294MongoDB 2019(1) Follow this ht ... -
Monitor Tool 2019(1)Monit Installation and Usage
2019-10-17 08:22 325Monitor Tool 2019(1)Monit Insta ... -
Ansible 2019(1)Introduction and Installation on Ubuntu and CentOS
2019-10-12 06:15 312Ansible 2019(1)Introduction and ... -
Timezone and Time on All Servers and Docker Containers
2019-10-10 11:18 332Timezone and Time on All Server ... -
Kafka Cluster 2019(6) 3 Nodes Cluster on CentOS7
2019-10-05 23:28 283Kafka Cluster 2019(6) 3 Nodes C ... -
K8S Helm(1)Understand YAML and Kubectl Pod and Deployment
2019-10-01 01:21 326K8S Helm(1)Understand YAML and ... -
Rancher and k8s 2019(5)Private Registry
2019-09-27 03:25 362Rancher and k8s 2019(5)Private ... -
Jenkins 2019 Cluster(1)Version 2.194
2019-09-12 02:53 444Jenkins 2019 Cluster(1)Version ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 373Redis Cluster 2019(3)Redis Clus ...
相关推荐
Bouncy Castle是一个强大的Java加密库,提供了对ECC的支持,包括密钥生成、加密解密等功能。下面我们将详细探讨如何使用Bouncy Castle库来实现ECC的双向加密解密。 1. **椭圆曲线加密原理**: 椭圆曲线加密算法...
Bouncy Castle 实现了 PKCS#1、PKCS#5、PKCS#7、PKCS#8 和 PKCS#12 等标准,这些标准涉及密钥管理、密码存储和数据封装等。 9. **JCE 兼容性**: 作为 JCE 的扩展,Bouncy Castle 可以作为替代提供更丰富的加密...
解决org/bouncycastle/jce/provider/bouncycastlepr错误专用。
BouncyCastle是一个强大的Java安全库,它为加密、数字签名、证书处理以及许多其他安全功能提供了全面的支持。在Android开发中,BouncyCastle扮演着重要角色,特别是在处理SSL/TLS连接、加密通信以及生成和验证X.509...
标题中的“java.lang.NoClassDefFoundError: javax/tools/StandardJavaFile”是一个常见的Java运行时错误,它表示在类路径中找不到某个类的定义。这个错误通常发生在试图执行包含特定类的代码,但该类在运行时环境中...
《深入解析org.bouncycastle:Java安全加密与证书权威库》 在Java开发中,安全性是不可或缺的一部分,尤其是在处理敏感数据、网络通信以及数字签名时。`org.bouncycastle`库是一个强大的开源加密库,为Java开发者...
**BouncyCastle.Crypto.dll** 是一个开源的加密库,主要为.NET Framework和.NET Core提供加密功能。在版本1.8.1中,这个库继续为开发者提供了广泛的密码学算法和安全服务。BouncyCastle 不仅限于.NET平台,它也支持...
**Bouncy Castle简介** Bouncy Castle是一个开源的Java加密库,提供了广泛的加密算法、协议实现以及相关的工具。这个jar包是专门为Java开发者设计的,它弥补了Java标准加密API(如JCE)在某些功能上的不足,使得...
BouncyCastle.Crypto.dll 是一个专门用于加密和解密操作的动态链接库,适用于C#编程语言。这个版本1.8.6是在2020年2月21日发布,是BouncyCastle库的最新迭代,为开发者提供了强大的安全功能。 BouncyCastle库本身是...
非对称加密,如RSA和ECC(椭圆曲线加密),在BouncyCastle中也得到良好支持。这类加密方式使用一对公钥和私钥,公钥可以公开,私钥必须保密,用于数字签名和密钥交换,确保了通信的机密性和身份验证。 3. **哈希...
《BouncyCastle1.59帮助文档:深入理解与CHM制作详解》 BouncyCastle,作为Java和.NET平台上广泛使用的开源加密库,为开发者提供了丰富的加密算法、密码学标准接口以及证书处理功能。这份“BouncyCastle1.59帮助...
BouncyCastle.Crypto.dll是一个开源的加密库,由The Legion of the Bouncy Castle组织开发,提供了大量加密算法和协议的实现,包括但不限于RSA、AES、DES、DH(Diffie-Hellman)、ECC(椭圆曲线密码学)等。...
RSA是最常见的非对称加密算法,Bouncy Castle也支持DSA和椭圆曲线加密(ECC),这些算法在密钥交换和数字签名中起着关键作用。 3. **数字签名**:Bouncy Castle可以创建和验证数字签名,这在确保数据完整性和来源...
BouncyCastle.Crypto.dll是.NET版本的核心组件,包含了大量加密算法的实现,如对称加密(如AES、DES、3DES)、非对称加密(RSA、DSA、ECC)、哈希算法(MD5、SHA-1、SHA-256等)以及消息认证码(MAC)等。...
Bouncy Castle 包含了密钥生成、导入和导出的工具,支持 PKCS#8 和 PKCS#12 格式。此外,它还支持密钥对的加密和解密,以保护密钥的安全存储。 6. **CMS(Cryptographic Message Syntax)** CMS 是一个标准,用于...
asn1 crypto i18n jce math mozilla ocsp openssl tsp util voms x509
《BouncyCastle.Crypto.dll 1.8.2:深入解析加密库的奥秘》 在信息技术领域,安全是至关重要的。特别是在网络通信、数据存储和传输等方面,强大的加密技术是保障信息安全的基础。BouncyCastle.Crypto.dll是这样一个...