Java中的密钥库密码加密 [英] Keystore password encrypting in java

查看:50
本文介绍了Java中的密钥库密码加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调用远程队列之前,我需要设置以下变量.

I need to set the following variables before invoking remote queue.

System.setProperty("javax.net.ssl.trustStore","C:\\certs\\trustStore.jks");
System.setProperty("javax.net.ssl.keyStore","C:\\keystore\\keyStore.jks");
System.setProperty("javax.net.ssl.keyStorePassword","Demo1234");
System.setProperty("javax.net.ssl.trustStorePassword","Demo1234");

密码在此处公开.加密密码的最佳方法是什么?

The passwords are exposed here. What is the best way to encrypt the passwords?

推荐答案

在某些时候,您的私钥/密钥存储区密码必须可见才能启用安全通信.它需要安全地存储在您的Web/应用服务器中.而且您的代码库需要安全地存储,并且只有需要查看它的人员才能访问.您可以将其加密存储在某个地方,然后解密以使用,但是您的加密和解密算法仍然可见并且可能被仿真,因此在某些时候,可以使用访问明文的方法,这只是确保它是仅适用于尽可能少的人,并且通过您的网络安全性尽量避免窥视.

At some point, your private key/key store password must be visible to enable secure communications to take place. It needs to be stored securely within your web/app server. And your code base needs to be securely stored and only accessible to the people who need to see it. You could store it encrypted somewhere and decrypt it for use, but your encryption and decryption algorithm would still be visible and potentially emulated, so at some point, the means to access the clear text will be available and it's merely a matter of ensuring that it's only available to as few people as possible and kept from prying eyes as far as possible via your network security.

如果需要,请在此处使用加密技术:如何在Java中加密字符串

Encryption technique here, if you need it: How to encrypt String in Java

这篇关于Java中的密钥库密码加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆