community.crypto.openssl_publickey_info module – Provide information for OpenSSL public keys
Note
This module is part of the community.crypto collection (version 2.22.0).
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 module,
see Requirements for details.
To use it in a playbook, specify: community.crypto.openssl_publickey_info
.
New in community.crypto 1.7.0
Synopsis
This module allows one to query information on OpenSSL public keys.
It uses the cryptography python library to interact with OpenSSL.
Requirements
The below requirements are needed on the host that executes this module.
cryptography >= 1.2.3
Parameters
Parameter |
Comments |
---|---|
Remote absolute path where the public key file is loaded from. |
|
Determines which crypto backend to use. The default choice is If set to Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- community.crypto.openssl_publickey
Generate an OpenSSL public key from its private key.
- community.crypto.openssl_privatekey_info
Provide information for OpenSSL private keys.
- community.crypto.openssl_publickey_info filter plugin
A filter variant of this module.
Examples
- name: Generate an OpenSSL private key with the default values (4096 bits, RSA)
community.crypto.openssl_privatekey:
path: /etc/ssl/private/ansible.com.pem
- name: Create public key from private key
community.crypto.openssl_publickey:
privatekey_path: /etc/ssl/private/ansible.com.pem
path: /etc/ssl/ansible.com.pub
- name: Get information on public key
community.crypto.openssl_publickey_info:
path: /etc/ssl/ansible.com.pub
register: result
- name: Dump information
ansible.builtin.debug:
var: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Fingerprints of public key. For every hash algorithm available, the fingerprint is computed. Returned: success Sample: |
|
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 |
|
The Returned: When |
|
The key’s type. One of Will start with Returned: success Sample: |