gpt4 book ai didi

java - 在 .class 文件 Intellij 中设置断点

转载 作者:行者123 更新时间:2023-11-30 07:48:24 26 4
gpt4 key购买 nike

我正在尝试调试 this 中提到的代码问题,更具体地说,是以下代码中的最后一行:

        // client credentials
KeyStore keyStore = null;

keyStore = KeyStore.getInstance("PKCS12", "BC");
keyStore.load(null, null);
keyStore.setKeyEntry(CryptographyUtils.CLIENT_NAME, endCredential.getPrivateKey(), CryptographyUtils.CLIENT_PASSWORD,
new Certificate[]{endCredential.getCertificate(), interCredential.getCertificate(), rootCredential.getCertificate()});
keyStore.store(new FileOutputStream(CryptographyUtils.CLIENT_NAME + ".p12"), CryptographyUtils.CLIENT_PASSWORD);

转到.store()声明(使用Ctrl + B)打开一个文件KeyStore.java:

public final void store(OutputStream stream, char[] password)
throws KeyStoreException, IOException, NoSuchAlgorithmException,
CertificateException
{
if (!initialized) {
throw new KeyStoreException("Uninitialized keystore");
}
keyStoreSpi.engineStore(stream, password);
}

最后一次调用.engineStore()实际上将证书写入输出流。转到方法的实现(Ctrl + Alt + B),显示以下选项:

store keys

导入的包含我代码中的方法的包来自:

import java.security.KeyStore;

我在KeyStore.java中放置了一个断点,并且已到达它。但是,反编译的 .class 文件中放置的断点(如图所示)则不然。

如何调试 .engineStore() 方法?

最佳答案

如果您想调试它,您需要附加源文件。您无法调试.class 文件。

See this post了解如何将源代码添加到库配置中。

关于java - 在 .class 文件 Intellij 中设置断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33596127/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com