Re: Encrypt existing PEM keyfile

"'David von Oheimb' via openssl-users" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
Hi, looks like you missed https://docs.openssl.org/master/man1/openssl-pkey/

David

Sep 24, 2024 19:44:11 Robert Moskowitz <rgm-tZ9RT1K724GHT8/[email protected]>:

> 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-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
> 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-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion on the web visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/0fb09083-7f23-41a3-bf7c-c7f821100e9d%40von-Oheimb.de.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.