package com.hdw.common.util.security;
import java.security.Provider;
/**
* To add the provider at runtime use:
* <pre>
* import java.security.Security;
* import org.security.provider.BouncyCastleProvider;
*
* Security.addProvider(new BouncyCastleProvider());
* </pre>
* The provider can also be configured as part of your environment via
* static registration by adding an entry to the java.security properties
* file (found in $JAVA_HOME/jre/lib/security/java.security, where
* $JAVA_HOME is the location of your JDK/JRE distribution). You'll find
* detailed instructions in the file but basically it comes down to adding
* a line:
* <pre>
* <code>
* security.provider.<n>=org.bouncycastle.jce.provider.BouncyCastleProvider
* </code>
* </pre>
* Where <n> is the preference you want the provider at (1 being the
* most prefered).
* <p>Note: JCE algorithm names should be uppercase only so the case insensitive
* test for getInstance works.
*
* @author TuMinglong
* @version $Id: BouncyCastleProvider.java, v 0.1 2014年3月25日 上午9:40:17 ShenHuaJie Exp $
*/
@SuppressWarnings("serial")
public class BouncyCastleProvider extends Provider {
private static final String info = "BouncyCastle Security Provider v1.23";
public static final String PROVIDER_NAME = "BC";
/**
* Construct a new provider. This should only be required when
* using runtime registration of the provider using the
* <code>Security.addProvider()</code> mechanism.
*/
public BouncyCastleProvider() {
super(PROVIDER_NAME, 1.23, info);
//
// KeyStore
//
put("KeyStore.BKS", "org.bouncycastle.jce.provider.JDKKeyStore");
put("KeyStore.BouncyCastle", "org.bouncycastle.jce.provider.JDKKeyStore$BouncyCastleStore");
put("KeyStore.PKCS12", "org.bouncycastle.jce.provider.JDKPKCS12KeyStore$BCPKCS12KeyStore");
put("KeyStore.BCPKCS12", "org.bouncycastle.jce.provider.JDKPKCS12KeyStore$BCPKCS12KeyStore");
put("KeyStore.PKCS12-DEF",
"org.bouncycastle.jce.provider.JDKPKCS12KeyStore$DefPKCS12KeyStore");
put("Alg.Alias.KeyStore.UBER", "BouncyCastle");
put("Alg.Alias.KeyStore.BOUNCYCASTLE", "BouncyCastle");
put("Alg.Alias.KeyStore.bouncycastle", "BouncyCastle");
//
// certificate factories.
//
put("CertificateFactory.X.509", "org.bouncycastle.jce.provider.JDKX509CertificateFactory");
put("Alg.Alias.CertificateFactory.X509", "X.509");
//
// algorithm parameter generators
//
put("AlgorithmParameterGenerator.DH",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DH");
put("AlgorithmParameterGenerator.DSA",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DSA");
put("AlgorithmParameterGenerator.ELGAMAL",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$ElGamal");
put("AlgorithmParameterGenerator.DES",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DES");
put("AlgorithmParameterGenerator.DESEDE",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DES");
put("AlgorithmParameterGenerator.1.2.840.113549.3.7",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DES");
put("AlgorithmParameterGenerator.1.3.14.3.2.7",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$DES");
put("AlgorithmParameterGenerator.IDEA",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$IDEA");
put("AlgorithmParameterGenerator.1.3.6.1.4.1.188.7.1.1.2",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$IDEA");
put("AlgorithmParameterGenerator.RC2",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$RC2");
put("AlgorithmParameterGenerator.1.2.840.113549.3.2",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$RC2");
put("AlgorithmParameterGenerator.CAST5",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$CAST5");
put("AlgorithmParameterGenerator.1.2.840.113533.7.66.10",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$CAST5");
put("AlgorithmParameterGenerator.AES",
"org.bouncycastle.jce.provider.JDKAlgorithmParameterGenerator$AES");
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.2", "AES"); // these first 3 are wrong, but seem to have got around
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.22", "AES");
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.42", "AES");
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.1.2", "AES");
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.1.22", "AES");
put("Alg.Alias.AlgorithmParameterGenerator.2.16.840.1.101.3.4.1.42", "AES");
//
// algorithm parameters
//
put("AlgorithmParameters.DH", "org.bouncycastle.jce.provider.JDKAlgorithmParameters$DH");
put("AlgorithmParameters.DSA", "org.bouncycastle.jce.provider.JDKAlgorithmParameters$DSA");
put("AlgorithmParameters.ELGAMAL",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$ElGamal");
put("AlgorithmParameters.IES", "org.bouncycastle.jce.provider.JDKAlgorithmParameters$IES");
put("AlgorithmParameters.PKCS12PBE",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$PKCS12PBE");
put("AlgorithmParameters.1.2.840.113549.3.7",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$IVAlgorithmParameters");
put("AlgorithmParameters.IDEA",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$IDEAAlgorithmParameters");
put("AlgorithmParameters.1.3.6.1.4.1.188.7.1.1.2",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$IDEAAlgorithmParameters");
put("AlgorithmParameters.CAST5",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$CAST5AlgorithmParameters");
put("AlgorithmParameters.1.2.840.113533.7.66.10",
"org.bouncycastle.jce.provider.JDKAlgorithmParameters$CAST5AlgorithmParameters");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHA1ANDRC2", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAAND3-KEYTRIPLEDES", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAAND2-KEYTRIPLEDES", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDRC2", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDRC4", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDTWOFISH", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.PBEWITHSHAANDIDEA", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.1", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.2", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.3", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.4", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.5", "PKCS12PBE");
put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.6", "PKCS12PBE");
//
// key agreement
//
put("KeyAgreement.DH", "org.bouncycastle.jce.provider.JCEDHKeyAgreement");
put("KeyAgreement.ECDH", "org.bouncycastle.jce.provider.JCEECDHKeyAgreement$DH");
put("KeyAgreement.ECDHC", "org.bouncycastle.jce.provider.JCEECDHKeyAgreement$DHC");
//
// cipher engines
//
put("Cipher.DES", "org.bouncycastle.jce.provider.JCEBlockCipher$DES");
put("Cipher.DESEDE", "org.bouncycastle.jce.provider.JC
hdw-dubbo微服务化开发平台,具有统一授权、认证后台管理系统
需积分: 1 117 浏览量
2023-08-20
20:31:28
上传
评论
收藏 11.35MB ZIP 举报
白话机器学习
- 粉丝: 8259
- 资源: 7686
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈