首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >java.security.NoSuchAlgorithmException: SHA224withRSA签名不可用Java7

java.security.NoSuchAlgorithmException: SHA224withRSA签名不可用Java7
EN

Stack Overflow用户
提问于 2017-04-04 21:20:27
回答 3查看 4.4K关注 0票数 1

我有Java环境Java 7,但我不能根据客户的要求将Java版本升级到8。

我需要连接一个支持TLSv1.2的网址,因此我启用了-Dhttps.protocols=TLSv1.2-Djavax.net.ssl.trustStore=<keystoreFilePath>-Djavax.net.ssl.trustStorePassword=<password>

我得到了下面的异常:

代码语言:javascript
复制
javax.net.ssl.SSLHandshakeException: Error signing certificate verify
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1904)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1054)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:341)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:837)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1023)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1092)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.security.NoSuchAlgorithmException: SHA224withRSA Signature not available
at java.security.Signature.getInstance(Signature.java:224)
at sun.security.ssl.JsseJce.getSignature(JsseJce.java:241)
at sun.security.ssl.HandshakeMessage$CertificateVerify.<init>(HandshakeMessage.java:1552)
at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1049)

我已经看过了针对已经面临的问题给出的解决方案,但所有这些都需要升级到Java版本(当然,我已经检查了提供商提供的不包含SHA224withRSA签名的所有签名)。

供参考:

代码语言:javascript
复制
SUN version 1.7
    Alg.Alias.Signature.SHA1/DSA
    Alg.Alias.Signature.1.2.840.10040.4.3
    Alg.Alias.Signature.DSS
    SecureRandom.SHA1PRNG ImplementedIn
    KeyStore.JKS
    Alg.Alias.MessageDigest.SHA-1
    MessageDigest.SHA
    KeyStore.CaseExactJKS
    CertStore.com.sun.security.IndexedCollection ImplementedIn
    Alg.Alias.Signature.DSA
    KeyFactory.DSA ImplementedIn
    KeyStore.JKS ImplementedIn
    AlgorithmParameters.DSA ImplementedIn
    Signature.NONEwithDSA
    Alg.Alias.CertificateFactory.X509
    CertStore.com.sun.security.IndexedCollection
    Provider.id className
    Alg.Alias.Signature.SHA-1/DSA
    CertificateFactory.X.509 ImplementedIn
    Signature.SHA1withDSA KeySize
    KeyFactory.DSA
    CertPathValidator.PKIX ImplementedIn
    Configuration.JavaLoginConfig
    Alg.Alias.Signature.OID.1.2.840.10040.4.3
    Alg.Alias.KeyFactory.1.2.840.10040.4.1
    MessageDigest.MD5 ImplementedIn
    Alg.Alias.Signature.RawDSA
    Provider.id name
    Alg.Alias.AlgorithmParameters.1.2.840.10040.4.1
    CertPathBuilder.PKIX ValidationAlgorithm
    Policy.JavaPolicy
    Alg.Alias.AlgorithmParameters.1.3.14.3.2.12
    Alg.Alias.Signature.SHA/DSA
    Alg.Alias.KeyPairGenerator.1.3.14.3.2.12
    MessageDigest.SHA-384
    Signature.SHA1withDSA ImplementedIn
    AlgorithmParameterGenerator.DSA
    Signature.NONEwithDSA SupportedKeyClasses
    MessageDigest.SHA-512
    CertPathBuilder.PKIX
    Alg.Alias.Signature.1.3.14.3.2.27
    CertPathBuilder.PKIX ImplementedIn
    Provider.id version
    AlgorithmParameters.DSA
    Signature.SHA1withDSA SupportedKeyClasses
    CertStore.Collection
    AlgorithmParameterGenerator.DSA ImplementedIn
    KeyPairGenerator.DSA KeySize
    CertStore.LDAP
    CertificateFactory.X.509
    SecureRandom.NativePRNG
    CertStore.LDAP LDAPSchema
    CertStore.LDAP ImplementedIn
    KeyPairGenerator.DSA ImplementedIn
    CertPathValidator.PKIX ValidationAlgorithm
    CertStore.Collection ImplementedIn
    Alg.Alias.Signature.1.3.14.3.2.13
    CertPathValidator.PKIX
    Alg.Alias.MessageDigest.SHA1
    AlgorithmParameterGenerator.DSA KeySize
    SecureRandom.SHA1PRNG
    Signature.SHA1withDSA
    Alg.Alias.KeyFactory.1.3.14.3.2.12
    KeyPairGenerator.DSA
    MessageDigest.SHA ImplementedIn
    Provider.id info
    Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1
    Alg.Alias.Signature.SHAwithDSA
    MessageDigest.MD5
    Alg.Alias.Signature.DSAWithSHA1
    MessageDigest.SHA-256
    Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1
    MessageDigest.MD2
SunRsaSign version 1.7
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.4
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.2
    Alg.Alias.KeyFactory.1.2.840.113549.1.1
    Signature.SHA512withRSA SupportedKeyClasses
    Provider.id version
    Signature.MD5withRSA SupportedKeyClasses
    Alg.Alias.Signature.1.2.840.113549.1.1.13
    KeyPairGenerator.RSA
    Alg.Alias.Signature.1.2.840.113549.1.1.12
    Alg.Alias.Signature.1.2.840.113549.1.1.11
    KeyFactory.RSA
    Alg.Alias.Signature.1.3.14.3.2.29
    Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1
    Signature.MD2withRSA
    Signature.SHA384withRSA
    Signature.MD5withRSA
    Provider.id info
    Signature.SHA1withRSA SupportedKeyClasses
    Signature.SHA1withRSA
    Alg.Alias.Signature.1.2.840.113549.1.1.5
    Signature.SHA256withRSA
    Alg.Alias.Signature.1.2.840.113549.1.1.4
    Provider.id className
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.13
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.12
    Alg.Alias.Signature.1.2.840.113549.1.1.2
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.11
    Signature.MD2withRSA SupportedKeyClasses
    Provider.id name
    Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1
    Signature.SHA384withRSA SupportedKeyClasses
    Signature.SHA512withRSA
    Signature.SHA256withRSA SupportedKeyClasses
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.5
    Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1
SunEC version 1.7
    KeyFactory.EC
    Signature.SHA1withECDSA ImplementedIn
    Provider.id version
    KeyPairGenerator.EC ImplementedIn
    Signature.SHA1withECDSA SupportedKeyClasses
    AlgorithmParameters.EC
    Signature.SHA512withECDSA SupportedKeyClasses
    KeyAgreement.ECDH
    Alg.Alias.KeyPairGenerator.EllipticCurve
    KeyAgreement.ECDH ImplementedIn
    Signature.NONEwithECDSA SupportedKeyClasses
    Signature.SHA256withECDSA
    Alg.Alias.AlgorithmParameters.EllipticCurve
    KeyPairGenerator.EC
    AlgorithmParameters.EC SupportedCurves
    Signature.SHA512withECDSA ImplementedIn
    Signature.SHA384withECDSA SupportedKeyClasses
    Signature.NONEwithECDSA
    Provider.id info
    Signature.SHA512withECDSA
    Alg.Alias.KeyFactory.EllipticCurve
    AlgorithmParameters.EC ImplementedIn
    Signature.NONEwithECDSA ImplementedIn
    Provider.id className
    Signature.SHA384withECDSA ImplementedIn
    KeyFactory.EC ImplementedIn
    Signature.SHA256withECDSA ImplementedIn
    AlgorithmParameters.EC KeySize
    KeyPairGenerator.EC KeySize
    Provider.id name
    Signature.SHA256withECDSA SupportedKeyClasses
    Signature.SHA1withECDSA
    Signature.SHA384withECDSA
    KeyAgreement.ECDH SupportedKeyClasses
    Signature.SHA1withECDSA KeySize
SunJSSE version 1.7
    Signature.MD5andSHA1withRSA
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.2
    Alg.Alias.KeyManagerFactory.PKIX
    Provider.id name
    KeyManagerFactory.NewSunX509
    Alg.Alias.Signature.OID.1.3.14.3.2.29
    Signature.MD2withRSA
    Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1
    Provider.id version
    KeyManagerFactory.SunX509
    KeyFactory.RSA
    TrustManagerFactory.SunX509
    Alg.Alias.TrustManagerFactory.X.509
    SSLContext.TLSv1.2
    SSLContext.TLSv1.1
    Signature.MD5withRSA
    Alg.Alias.SSLContext.SSLv3
    Alg.Alias.SSLContext.SSL
    KeyStore.PKCS12
    Alg.Alias.TrustManagerFactory.SunPKIX
    Alg.Alias.SSLContext.TLS
    Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1
    SSLContext.Default
    Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1
    Provider.id info
    Signature.SHA1withRSA
    TrustManagerFactory.PKIX
    SSLContext.TLSv1
    Alg.Alias.Signature.1.3.14.3.2.29
    Alg.Alias.Signature.1.2.840.113549.1.1.5
    Alg.Alias.TrustManagerFactory.X509
    Provider.id className
    Alg.Alias.Signature.1.2.840.113549.1.1.4
    Alg.Alias.KeyFactory.1.2.840.113549.1.1
    Alg.Alias.Signature.1.2.840.113549.1.1.2
    KeyPairGenerator.RSA
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.5
    Alg.Alias.Signature.OID.1.2.840.113549.1.1.4
SunJCE version 1.7
    Cipher.Blowfish SupportedKeyFormats
    AlgorithmParameters.DESede
    AlgorithmParameters.DES
    Cipher.DES SupportedPaddings
    AlgorithmParameters.Blowfish
    Cipher.DESedeWrap SupportedKeyFormats
    Alg.Alias.KeyAgreement.1.2.840.113549.1.3.1
    AlgorithmParameterGenerator.DiffieHellman
    Cipher.RSA SupportedPaddings
    Alg.Alias.Cipher.TripleDES
    Cipher.ARCFOUR SupportedModes
    Mac.SslMacSHA1 SupportedKeyFormats
    KeyGenerator.DES
    Provider.id version
    KeyGenerator.DESede
    Alg.Alias.SecretKeyFactory.PBE
    Alg.Alias.KeyFactory.1.2.840.113549.1.3.1
    Mac.HmacSHA1
    Cipher.PBEWithMD5AndDES
    Cipher.AES SupportedModes
    Cipher.AESWrap SupportedModes
    SecretKeyFactory.DESede
    KeyGenerator.SunTlsKeyMaterial
    AlgorithmParameters.OAEP
    Cipher.AES SupportedKeyFormats
    AlgorithmParameters.RC2
    AlgorithmParameters.PBE
    Alg.Alias.KeyPairGenerator.DH
    Alg.Alias.KeyAgreement.OID.1.2.840.113549.1.3.1
    Cipher.AES
    KeyGenerator.RC2
    Mac.HmacSHA512
    Provider.id info
    Cipher.AES SupportedPaddings
    Alg.Alias.AlgorithmParameters.OID.1.2.840.113549.1.12.1.6
    Cipher.Blowfish SupportedPaddings
    Alg.Alias.AlgorithmParameters.OID.1.2.840.113549.1.12.1.3
    Alg.Alias.KeyGenerator.SunTls12KeyMaterial
    KeyStore.JCEKS
    Cipher.Blowfish SupportedModes
    Alg.Alias.SecretKeyFactory.1.2.840.113549.1.5.12
    Mac.HmacSHA384 SupportedKeyFormats
    Cipher.DESedeWrap
    Cipher.ARCFOUR SupportedPaddings
    Alg.Alias.KeyPairGenerator.1.2.840.113549.1.3.1
    Cipher.PBEWithMD5AndTripleDES
    Alg.Alias.Cipher.1.2.840.113549.1.12.1.6
    Alg.Alias.Cipher.1.2.840.113549.1.12.1.3
    Mac.HmacSHA256 SupportedKeyFormats
    Alg.Alias.KeyGenerator.SunTls12RsaPremasterSecret
    Alg.Alias.AlgorithmParameterGenerator.1.2.840.113549.1.3.1
    Cipher.PBEWithSHA1AndDESede
    Alg.Alias.KeyGenerator.SunTls12MasterSecret
    SecretKeyFactory.PBEWithMD5AndDES
    KeyPairGenerator.DiffieHellman
    Cipher.RC2 SupportedModes
    Alg.Alias.AlgorithmParameters.Rijndael
    KeyAgreement.DiffieHellman SupportedKeyClasses
    Mac.HmacMD5 SupportedKeyFormats
    KeyGenerator.SunTlsRsaPremasterSecret
    Cipher.AESWrap SupportedKeyFormats
    SecretKeyFactory.DES
    Cipher.AESWrap SupportedPaddings
    Provider.id name
    KeyGenerator.HmacSHA512
    Mac.HmacSHA256
    Cipher.ARCFOUR SupportedKeyFormats
    Cipher.DES SupportedModes
    Cipher.RSA SupportedKeyClasses
    SecretKeyFactory.PBEWithMD5AndTripleDES
    Cipher.PBEWithSHA1AndRC2_40
    AlgorithmParameters.DiffieHellman
    Mac.HmacMD5
    Cipher.RSA
    Mac.SslMacMD5
    Alg.Alias.AlgorithmParameters.OID.1.2.840.113549.1.5.3
    Cipher.DESede SupportedPaddings
    Alg.Alias.AlgorithmParameterGenerator.OID.1.2.840.113549.1.3.1
    Cipher.DESede
    Alg.Alias.AlgorithmParameters.OID.1.2.840.113549.1.3.1
    Alg.Alias.AlgorithmParameters.1.2.840.113549.1.5.3
    Mac.HmacSHA512 SupportedKeyFormats
    Mac.HmacPBESHA1 SupportedKeyFormats
    Alg.Alias.AlgorithmParameterGenerator.DH
    Cipher.DESedeWrap SupportedPaddings
    Alg.Alias.SecretKeyFactory.OID.1.2.840.113549.1.5.12
    Alg.Alias.AlgorithmParameters.1.2.840.113549.1.3.1
    Mac.HmacPBESHA1
    Cipher.DES SupportedKeyFormats
    AlgorithmParameters.PBEWithMD5AndTripleDES
    Cipher.DESedeWrap SupportedModes
    Alg.Alias.KeyFactory.OID.1.2.840.113549.1.3.1
    Alg.Alias.Cipher.OID.1.2.840.113549.1.5.3
    AlgorithmParameters.AES
    Alg.Alias.AlgorithmParameters.TripleDES
    Alg.Alias.SecretKeyFactory.TripleDES
    KeyGenerator.HmacSHA256
    Alg.Alias.KeyGenerator.TripleDES
    Alg.Alias.AlgorithmParameters.DH
    KeyGenerator.AES
    Cipher.RC2 SupportedPaddings
    Alg.Alias.Cipher.RC4
    Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.3.1
    Mac.HmacSHA384
    SecretKeyFactory.PBKDF2WithHmacSHA1
    Provider.id className
    Cipher.DES
    Cipher.Blowfish
    KeyGenerator.SunTlsMasterSecret
    KeyGenerator.HmacSHA1
    Alg.Alias.SecretKeyFactory.1.2.840.113549.1.5.3
    KeyGenerator.SunTlsPrf
    SecretKeyFactory.PBEWithSHA1AndDESede
    KeyGenerator.ARCFOUR
    Alg.Alias.KeyAgreement.DH
    Alg.Alias.KeyGenerator.Rijndael
    AlgorithmParameters.PBEWithSHA1AndDESede
    Alg.Alias.KeyGenerator.RC4
    Alg.Alias.Cipher.OID.1.2.840.113549.1.12.1.6
    Alg.Alias.Cipher.OID.1.2.840.113549.1.12.1.3
    Mac.SslMacMD5 SupportedKeyFormats
    Mac.HmacSHA1 SupportedKeyFormats
    Cipher.DESede SupportedKeyFormats
    Cipher.RC2
    KeyGenerator.SunTls12Prf
    SecretKeyFactory.PBEWithSHA1AndRC2_40
    KeyGenerator.HmacMD5
    AlgorithmParameters.PBEWithSHA1AndRC2_40
    KeyGenerator.HmacSHA384
    Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.6
    KeyFactory.DiffieHellman
    Alg.Alias.AlgorithmParameters.1.2.840.113549.1.12.1.3
    AlgorithmParameters.PBEWithMD5AndDES
    Alg.Alias.SecretKeyFactory.1.2.840.113549.1.12.1.6
    Alg.Alias.SecretKeyFactory.1.2.840.113549.1.12.1.3
    Cipher.AESWrap
    Alg.Alias.SecretKeyFactory.OID.1.2.840.113549.1.5.3
    Alg.Alias.Cipher.Rijndael
    Cipher.RSA SupportedModes
    Cipher.DESede SupportedModes
    Alg.Alias.SecretKeyFactory.OID.1.2.840.113549.1.12.1.6
    Alg.Alias.SecretKeyFactory.OID.1.2.840.113549.1.12.1.3
    Cipher.ARCFOUR
    Alg.Alias.Cipher.1.2.840.113549.1.5.3
    Mac.SslMacSHA1
    KeyAgreement.DiffieHellman
    Cipher.RC2 SupportedKeyFormats
    Alg.Alias.KeyFactory.DH
    KeyGenerator.Blowfish
SunJGSS version 1.7
    GssApiMechanism.1.3.6.1.5.5.2
    Provider.id info
    Provider.id className
    Provider.id version
    GssApiMechanism.1.2.840.113554.1.2.2
    Provider.id name
SunSASL version 1.7
    SaslClientFactory.NTLM
    Provider.id className
    SaslClientFactory.CRAM-MD5
    Provider.id version
    SaslClientFactory.EXTERNAL
    SaslClientFactory.PLAIN
    SaslClientFactory.DIGEST-MD5
    SaslServerFactory.NTLM
    Provider.id name
    SaslClientFactory.GSSAPI
    SaslServerFactory.DIGEST-MD5
    SaslServerFactory.CRAM-MD5
    SaslServerFactory.GSSAPI
    Provider.id info
XMLDSig version 1.0
    Alg.Alias.TransformService.ENVELOPED
    Alg.Alias.TransformService.XSLT
    Provider.id name
    TransformService.http://www.w3.org/2006/12/xml-c14n11#WithComments
    TransformService.http://www.w3.org/TR/1999/REC-xslt-19991116 MechanismType
    TransformService.http://www.w3.org/2001/10/xml-exc-c14n#WithComments MechanismType
    TransformService.http://www.w3.org/2000/09/xmldsig#base64 MechanismType
    TransformService.http://www.w3.org/2006/12/xml-c14n11
    TransformService.http://www.w3.org/2002/06/xmldsig-filter2 MechanismType
    TransformService.http://www.w3.org/2001/10/xml-exc-c14n# MechanismType
    TransformService.http://www.w3.org/TR/1999/REC-xpath-19991116 MechanismType
    TransformService.http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments MechanismType
    TransformService.http://www.w3.org/TR/2001/REC-xml-c14n-20010315
    Provider.id version
    KeyInfoFactory.DOM
    Alg.Alias.TransformService.XPATH
    TransformService.http://www.w3.org/2000/09/xmldsig#enveloped-signature
    Alg.Alias.TransformService.BASE64
    TransformService.http://www.w3.org/2006/12/xml-c14n11 MechanismType
    Alg.Alias.TransformService.EXCLUSIVE_WITH_COMMENTS
    TransformService.http://www.w3.org/TR/2001/REC-xml-c14n-20010315 MechanismType
    Provider.id info
    TransformService.http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
    Alg.Alias.TransformService.INCLUSIVE
    Alg.Alias.TransformService.XPATH2
    TransformService.http://www.w3.org/2000/09/xmldsig#enveloped-signature MechanismType
    TransformService.http://www.w3.org/TR/1999/REC-xslt-19991116
    TransformService.http://www.w3.org/TR/1999/REC-xpath-19991116
    Alg.Alias.TransformService.EXCLUSIVE
    TransformService.http://www.w3.org/2006/12/xml-c14n11#WithComments MechanismType
    TransformService.http://www.w3.org/2001/10/xml-exc-c14n#
    TransformService.http://www.w3.org/2000/09/xmldsig#base64
    XMLSignatureFactory.DOM
    TransformService.http://www.w3.org/2002/06/xmldsig-filter2
    Provider.id className
    TransformService.http://www.w3.org/2001/10/xml-exc-c14n#WithComments
    Alg.Alias.TransformService.INCLUSIVE_WITH_COMMENTS
SunPCSC version 1.7
    Provider.id info
    Provider.id className
    Provider.id version
    Provider.id name
    TerminalFactory.PC/SC

但是我不能升级到Java 8,因为客户端的要求不是升级到Java 8。

请提供不升级到Java 8的解决方案,提前谢谢!

EN

回答 3

Stack Overflow用户

发布于 2018-06-01 10:59:51

我已经在我的机器上检查了java版本(1.7)和(1.8)所支持的算法。我的一个项目运行在jdk 1.7.0_80上,它不支持SHA224withRSA算法,如果你处于同样的情况,那么至少升级到更新的java版本(JavaSE7Update131),因为我读到它应该有类似于Java8的算法。如果没有更新java的选项,那么尝试在pom或jar文件中添加org.bouncycastle bcprov-jdk15on maven依赖项到您的项目中&也可以在java代码中添加您构建SSLContext/HttpClient的地方包括以下行:

新Security.addProvider(

BouncyCastleProvider());

我也试过安装Java加密扩展(JCE)无限强度权限策略文件7,但它对我不起作用!!

票数 1
EN

Stack Overflow用户

发布于 2021-10-17 16:55:17

我也面临着同样的问题,但我得到了解决方案。jdk 1.7.0_80,不支持SHA224withRSA算法。所以我们必须使用第三方供应商来包含签名,我们可以使用JCE、开放jdk等。我使用开放JDK 7来解决这个问题。请转到此url https://www.azul.com/downloads/?architecture=x86-64-bit&package=jdk向下滚动并搜索7u312b01。

然后点击.zip,下载后解压,在eclipse中右键点击项目-> run as -> Run configuration -> JRE选项卡-> Alternate JRE (单选按钮) -> install-> add -> standard vm-> next-> Directory -> search location of open jdk7 (zulu7.48.0.11-ca-jdk7.0.312-->_x64)选择folder-> finish -> apply -> close->

单击run并查看魔术...控制台将显示SHA224withRSA。当您运行这些代码时

代码语言:javascript
复制
TreeSet<String> algorithms = new TreeSet<>();
    for (Provider provider : Security.getProviders())
        for (Service service : provider.getServices())
            if (service.getType().equals("Signature"))
                algorithms.add(service.getAlgorithm());
    for (String algorithm : algorithms)
        System.out.println(algorithm);

欲了解更多详情,请访问https://techoral.com/blog/java/how-to-download-and-install-openjdk-7-on-windows.html

https://community.oracle.com/tech/developers/discussion/4172681/where-we-can-download-jdk1-7-0-191

票数 1
EN

Stack Overflow用户

发布于 2018-10-19 03:21:13

如果有人在使用Java8+SHA224时遇到问题,请使用

在迁移到Java8 (v101)之后,我遇到了同样的错误,因为我的应用程序同时使用SunMSCAPI和SHA224中的私钥。为了寻找答案,我发现降级到8.0.51版本解决了这个问题(可以在低于100的其他版本中工作)。

原因:在启用SunMSCAPI时,他们从默认提供程序中删除了SHA224。来源:https://bugs.openjdk.java.net/browse/JDK-8064330

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43208468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档