问题描述
我的FS(S3 AWS密钥)上有一个文件,其中包含一个字符串,该字符串是我用于加密过程的密钥。
I have a file on my FS (a S3 AWS key) that contains a string that is a key I use for encryption process.
我想移动它是一个Java KeyStore。
I would like to move it a Java KeyStore.
我知道如何使用keytool将证书导入KeyStore,但我找不到导入简单字符串键的方法。
I know how to import a certificate into a KeyStore with keytool but I can't find the way to import a simple string key.
你能帮忙吗?
推荐答案
我看不到办法它与keytool,但有些戳,我想知道你是否可以在代码中存储和检索它作为PasswordBasedEncryption(PBE)SecretKey。 (免责声明:我自己没试过这个。)
I don't see a way to do it with keytool, but some poking about, I wonder if you could store and retrieve it in code as a PasswordBasedEncryption (PBE) SecretKey. (Disclaimer: I haven't tried this myself).
推动这种想法的资源:
和
The resources that drove this thought:PBEKeySpec javadoc and CryptoSpec - Using Password Based Encryption example
这篇关于如何在Java KeyStore中存储一个简单的密钥字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!