Re: Encrypt existing PEM keyfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ARGH!!!  :)

Like I said, my search foo is weak.

And I use "openssl pkey" often enough to display the PEM content.

Sigh.    Thanks.

On 9/25/24 00:16, David von Oheimb wrote:
Hi, looks like you missed https://docs.openssl.org/master/man1/openssl-pkey/

David

Sep 24, 2024 19:44:11 Robert Moskowitz <rgm@xxxxxxxxxxxxxxx>:

Right now I want to use openssl command line to be able to take as input an unecrypted PEM Keyfile (EdDSA) and output it password protected.

I have created the keyfile in python using:

        f.write(private_key.private_bytes(
            encoding=serialization.Encoding.PEM,
            format=serialization.PrivateFormat.PKCS8,
            encryption_algorithm=serialization.NoEncryption(),
            ))

I have found that to have written it encrypted, that should be

encryption_algorithm=serialization.BestAvailableEncryption(b'xyz'))

But I want to be able to work this out step by step, adding the encryption of the PEM keyfile.

Thus the desire to take an existing unprotected PEM and put out a password protected one that I can read in to another script.

Looked all over in the docs and asked Dr. Google, but my search foo is still weak and not finding this out.

Would someone point the way for me?  :)

Also is the "BestAvailableEncryption" the way to write it password protected in the first place?

Thanks!


--
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe@xxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/9893dea9-dfcc-4525-a36a-af7d371bfde2%40htt-consult.com.

--
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe@xxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/78e2bebe-7339-480e-9e19-b0321674a218%40htt-consult.com.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux