问题标签 [pyjks]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 无法使用 pyjks 打开 JCEKS 密钥库
我正在尝试使用pyjks模块从密钥库中获取密钥,但是加载密钥库失败并出现以下错误:
如果我尝试使用keytool
加载密钥库,我没有问题。我想知道是否有人曾经pyjks
这样做并成功地做到了这一点。这是我的python代码片段:
python - pyjks保存keytool无法打开的jks文件
我想使用 pyjks 加载包含受信任证书的密钥库,并且我一直在尝试添加受信任证书,从文件('trust2.pub')中读取。
这实际上将 jks 文件与新条目一起保存,如果我尝试使用给定密码重新加载文件,我可以看到它。但是当我尝试使用 ubuntu 中的 keytool 或 Windows 中的 KeyStore Explorer 打开它时,我收到以下错误:
java.io.IOException:DER 长度的短读
所以,也许这是我在 jks 文件中添加新的 TrustedCertEntry 的方式,但我不知道,因为 pyjks 加载它没有问题。
如果有人可以提供帮助,我将不胜感激。
谢谢
pyopenssl - Unable to load PEM-encoded private key from Pyjks into PKey object
I'm loading a Pyjks PrivateKeyEntry object into PEM and then trying to load the pem-encoded string into a Pkey object. As you might have guessed, I'm trying to export PrivateKeyEntry along with it's cert chain into a file. We have an UI that is able to import certs and p12 containers into java keystores and I'm trying to make them downloadable too.
However, the error I'm getting from OpenSSL.crypto library is useless to say the least:
Pyjks also shows this being done the same way: https://github.com/kurtbrose/pyjks/blob/master/tools/readks.py I'm able to export a certificate like this just fine.
EDIT: Also tried with load_privatekey(crypto.FILETYPE_ASN1, pkey_pem._pkey)
, results in similar cryptic error message:
keystore - 如何应对异常“不是 JKS 或 JCEKS 密钥库(幻数错误;预期 FEEDFEED 或 CECECECE)”
我正在使用 pyjks 读取 jks 文件并找到私钥以进行进一步加密。在 Windows 系统中这很容易,但我无法弄清楚如果我们在 linux 环境下应该做什么。我有一个自签名证书,从中我提取了私钥和公共证书。现在我需要将它存储在 linux 的密钥库中,该 java 密钥库将被 python 脚本进一步读取以获取私钥并进行解密。
蟒蛇代码:
抛出的异常是:BadKeystoreFormatException: Not a JKS or JCEKS keystore (magic number wrong; expected FEEDFEED or CECECECE)
python - 是否可以使用 python 创建带有 sha_hash 的 SHACertificate?
我看到使用 Java 可以做到这一点,我使用 PyJKS 创建了密钥库文件,该文件具有 PrivateKeyEntry 包含供我使用的 sha1 指纹,但我不知道如何将其转换为 SHACertificate 或 sha_hash上传到火力基地
python-3.x - 如何从 .jks 文件中获取 pem?
我正在尝试使用 .jks 文件来签署 jwt 令牌。我使用的库是 pyjwt 和 pyjks。以下是代码片段:
在执行最后一行代码以使用 jks 签名生成 jwt 时,它会抛出错误,提示需要 PEM 格式的密钥。我认为pk格式不是 jwk 所需要的。我的问题是如何从 .jks 中提取 pem 文件格式的文件来签署 jwk 令牌?谢谢。
python - 如何在 Python 中使用 JCEKS 密钥库进行 AES 加密?
我有一个包含秘密条目的 JCEKS 文件。我应该使用密钥存储中的这个秘密条目,并使用它来使用 Python 执行 AES 加密。
我能够使用 Python 中的 pyjks 库在 Python 中加载 KeyStore 文件。
我可以通过尝试以下操作来查看我的秘密条目 -
返回以下值
但我不确定如何访问此密钥,以便可以将其用作 AES 加密中的密钥