密码机:硬件加密模块、HSM,支持国密的SM3WITHSM2算法
BC:BouncyCastle,开源第三方安全组件,支持SM3摘要,尚不支持sm2
OIDS:
SM3withSM2 OID 为1.2.156.10197.1.501。
SM2的公钥参数OID为1.2.156.10197.1.301
<QQ:22066821>
正常的SHA1withRSA证书是这样的:
重
BC:BouncyCastle,开源第三方安全组件,支持SM3摘要,尚不支持sm2
OIDS:
SM3withSM2 OID 为1.2.156.10197.1.501。
SM2的公钥参数OID为1.2.156.10197.1.301
<QQ:22066821>
正常的SHA1withRSA证书是这样的:
X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(new X500Name(issuer),
serial, notBefore,notAfter, new X500Name(subject), publicKey);
// "SHA1withRSA"
ContentSigner sigGen = new JcaContentSignerBuilder(alg).setProvider("BC").build(privKey);
X509CertificateHolder holder = builder.build(sigGen);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream is1 = new ByteArrayInputStream(holder.toASN1Structure().getEncoded());
X509Certificate theCert = (X509Certificate) cf.generateCertificate(is1);
is1.close();
重