Questions tagged [pyjks]

pyjks is a pure python jks file parser.

A pure python Java KeyStore file parser, including private key decryption.

Documentation Link: https://pypi.python.org/pypi/pyjks

8 questions
3
votes
1 answer

How to counter the exception "Not a JKS or JCEKS keystore (magic number wrong; expected FEEDFEED or CECECECE)"

I am using pyjks to read a jks file and find private key for further encryption. It is quite easy in Windows system but I am not able to figure out what should be done if we are on linux environment. I have a self-signed certificate, from that I…
Mousam Singh
  • 675
  • 2
  • 9
  • 29
1
vote
1 answer

How do I get the pem from .jks file?

I am trying to use the .jks file to sign the jwt token. The libraries I am using are pyjwt and pyjks. Below is the code snippets: userDto = user payload = { "iss": "test", "exp": datetime.now(tz=timezone.utc)…
Felix
  • 23
  • 1
  • 6
1
vote
1 answer

Are there any python modules to store passwords securely in .conf/.txt files?

I am trying to read and write username and password in a secured manner. With my current implementation I am following AES-CBC encryption/decryption but storing the encrypted username the with random key in a config file is a security issue. I found…
Auto-learner
  • 1,411
  • 7
  • 26
  • 43
0
votes
1 answer

How to use a JCEKS Keystore in Python for AES Encryption?

I have a JCEKS file that contains a secret entry. I'm supposed to use this secret entry from the key store and use that to perform an AES encryption using Python. I was able to load the KeyStore file in Python using the pyjks library in Python. I'm…
deltaforce
  • 524
  • 1
  • 8
  • 25
0
votes
1 answer

Is it possible to create a SHACertificate with a sha_hash using python?

https://firebase.google.com/docs/reference/admin/java/reference/com/google/firebase/projectmanagement/ShaCertificate I see that it is possible to do so using Java, I have used PyJKS to create the keystore file which has a PrivateKeyEntry which…
0
votes
1 answer

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…
Xvs
  • 79
  • 2
  • 9
0
votes
1 answer

pyjks saves jks file which cannot be opened by keytool

I want to use pyjks to load a keystore containing trusted certificates and I've been trying to add a trusted certificate, read from a file ('trust2.pub') into it. import jks ks = jks.KeyStore.load('trustore_file.jks', 'trustore_pass') new_entry =…
unicorn
  • 139
  • 1
  • 9
0
votes
1 answer

Failure to open JCEKS keystore with pyjks

I'm trying to use the pyjks module to grab keys from a keystore, however loading the keystore fails with the following error: ValueError: Hash mismatch; incorrect password or data corrupted If I try using keytool to load the keystore, I have no…
Florin Stingaciu
  • 8,085
  • 2
  • 24
  • 45