community.crypto.openssl_privatekey_info filter – Retrieve information from OpenSSL private keys
Note
This filter plugin is part of the community.crypto collection (version 2.22.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.crypto
.
You need further requirements to be able to use this filter plugin,
see Requirements for details.
To use it in a playbook, specify: community.crypto.openssl_privatekey_info
.
New in community.crypto 2.10.0
Synopsis
Provided an OpenSSL private keys, retrieve information.
This is a filter version of the community.crypto.openssl_privatekey_info module.
Requirements
The below requirements are needed on the local controller node that executes this filter.
If
name_encoding
is set to another value thanignore
, the idna Python library needs to be installed.
Input
This describes the input of the filter, the value before | community.crypto.openssl_privatekey_info
.
Parameter |
Comments |
---|---|
The content of the OpenSSL private key. |
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1
, key2=value2
and so on in the following
example: input | community.crypto.openssl_privatekey_info(key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
How to encode names (DNS names, URIs, email addresses) in return values.
Note that Choices:
|
|
The passphrase for the private key. |
|
Whether to return private key data. Only set this to WARNING: you have to make sure that private key data is not accidentally logged! Choices:
|
See Also
See also
- community.crypto.openssl_privatekey_info
Provide information for OpenSSL private keys.
Examples
- name: Show the Subject Alt Names of the CSR
ansible.builtin.debug:
msg: >-
{{
(
lookup('ansible.builtin.file', '/path/to/cert.csr')
| community.crypto.openssl_privatekey_info
).subject_alt_name | join(', ')
}}
Return Value
Key |
Description |
---|---|
Information on the certificate. Returned: success |
|
Private key data. Depends on key type. Returned: success and when |
|
Public key data. Depends on key type. Returned: success |
|
The curve’s name for ECC. Returned: When |
|
The RSA key’s public exponent. Returned: When |
|
The maximum number of bits of a private key. This is basically the bit size of the subgroup used. Returned: When |
|
The This is the element spanning the subgroup of the multiplicative group of the prime field used. Returned: When |
|
The RSA key’s modulus. Returned: When |
|
The This is the prime modulus upon which arithmetic takes place. Returned: When |
|
The This is a prime that divides Returned: When |
|
Bit size of modulus (RSA) or prime number (DSA). Returned: When |
|
The Returned: When |
|
For For Returned: When |
|
Private key’s public key in PEM format. Returned: success Sample: |
|
Fingerprints of private key’s public key. For every hash algorithm available, the fingerprint is computed. Returned: success Sample: |
|
The key’s type. One of Will start with Returned: success Sample: |