跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] 可以利用 Java 的 Keystore 做一些数据加解密工作吗?

发表于
RT ,Java 开发的客户端想要与远端服务器建立 SSL 连接,就会提供一个 keystore ,这个 keystore 显然其使用证书的私钥,否则应该是无法完成 SSL 认证的。

而这个证书的公钥又是可以暴露的,或者说是必须要公开的。

所以我想的是,利用这个公钥去做加密,将加密的内容写在这个应用的配置文件里,再在程序启动的时候利用 keystore 去解密。这样就不用引入额外的密钥。

但我网上搜了一下,好像完全没有这样的讨论。是我的理解出了偏差,这个是做不到的吗?

如果可以,这里( 1 )利用 keystore 中的私钥去做解密,大家知道 java 代码该怎么写吗( 2 )利用公钥去加密这两部分,大家知道咋写吗?

谢谢!

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.