![]() The first thing we will want to do is generate an RSA key pair with the python cryptography library. You can use the repo I have created if you wish to follow along with the example.Ĭreating an Encrypted PEM Encoded RSA Key Pair Our intended outputs from this process will be a password for our private key, an encrypted PEM encoded RSA key, and a PEM encoded public key. I found that some other common crypt packages did not expose configuration in their python classes that are available in the underlying OpenSSL binary. It has all the necessary backends we need for PEM encoded keys and for applying our encrypted password. ![]() To achieve this, I used the python cryptography package. PEM encoded Private key is encrypted with a password for further security and to align with snowflakes recommendations.It is a PEM encoded format for both public and private keys. ![]() I didn't find a lot of clear documentation on what the best practice was to do this in a python environment, so ill share what I came up with that allows you to produce an RSA key pair with the following properties: I recently had a requirement to produce some code that can generate encrypted PEM encoded RSA key pairs that can be used for snowflake key pair authentication for service accounts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |