ansible-collections / community.crypto

The community.crypto collection for Ansible.
https://galaxy.ansible.com/ui/repo/published/community/crypto/
Other
99 stars 89 forks source link

openssl pkcs12 equivalent ansible module #579

Open baoj-dfo opened 1 year ago

baoj-dfo commented 1 year ago

what are equivalent ansible module for achieve these command ?

openssl pkcs12 -in $file -nocerts -nodes -out $certKey openssl pkcs12 -in $file -clcerts -nokeys -out $certPem

I've looked on openssl_privatekey, openssl_privatekey_info, openssl_pkcs12, openssl_privatekey_info, none of them can

felixfontein commented 1 year ago

There is no equivalent of these commands. The openssl_pkcs12 module can dump the private key, certificate, and CA certs into a single file, which comes close to what you want.

baoj-dfo commented 1 year ago

@felixfontein , thanks for your quick answer.

what are the output format of azure_rm_keyvaultkey_info and azure_rm_keyvaultsecret_info when retrieving certificate from Azure keyvault ? how to convert to PEM format ?

for azure_rm_keyvaultkey_info, I get its output['keys'][0].key for azure_rm_keyvaultsecret_info, I get its output.secrets[0].secret

felixfontein commented 1 year ago

I don't know, you'll have to check the documentation of the Azure collection containing these modules.

baoj-dfo commented 1 year ago

I've spend lots time try to figure out its equivalence for az keyvault secret download --vault-name $vault -n $cert -f $file --encoding base64

with no luck, any one else can help?

Most likely I have to use az cli instead of Azure collection module :(