如何在eclipse中调试sun.security包

时间:2014-03-20 15:41:42

标签: java security

我想用eclipse调试sun.security.rsa.RSAKeyFactory源代码,但是怎么做?

ProviderConfig: Loading provider: sun.security.rsa.SunRsaSign
Provider: Set SunRsaSign provider property     [KeyFactory.RSA/sun.security.rsa.RSAKeyFactory]
Provider: Set SunRsaSign provider property     [KeyPairGenerator.RSA/sun.security.rsa.RSAKeyPairGenerator]
Provider: Set SunRsaSign provider property     [Signature.MD2withRSA/sun.security.rsa.RSASignature$MD2withRSA]
Provider: Set SunRsaSign provider property     [Signature.MD5withRSA/sun.security.rsa.RSASignature$MD5withRSA]
Provider: Set SunRsaSign provider property     [Signature.SHA1withRSA/sun.security.rsa.RSASignature$SHA1withRSA]
Provider: Set SunRsaSign provider property     [Signature.SHA256withRSA/sun.security.rsa.RSASignature$SHA256withRSA]
Provider: Set SunRsaSign provider property     [Signature.SHA384withRSA/sun.security.rsa.RSASignature$SHA384withRSA]
Provider: Set SunRsaSign provider property     [Signature.SHA512withRSA/sun.security.rsa.RSASignature$SHA512withRSA]
Provider: Set SunRsaSign provider property     [Signature.MD2withRSA SupportedKeyClasses/java.security.interfaces.]

1 个答案:

答案 0 :(得分:4)

并非所有jdk

的来源

有些人说jdk的src.zip文件中应包含源代码。

这是我在C:\ Program Files \ Java \ jdk1.8.0_25 \ src.zip \ com \ sun \ security

中得到的
auth
jgss

所以没有provider目录,也没有rsa等。

解决方案

您可以看到文件来源here

要使用F3在Eclipse中工作,请下载zipped source。将其重命名为

C:\Program Files\Java\jdk1.8.0_25\src.zip

Linux的jdk src.zip也是incomplete

Eclipse设置

  • 如果在Eclipse中找不到F3的声明,请尝试this
  • 此外,如果您想打开实施声明,请尝试this