mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-07 05:43:06 +00:00
Get rid of backend parameter whenever possible (#883)
* Get rid of backend parameter whenever possible. * Always auto-detect if backend choices are 'cryptography' and 'auto', resp. always check cryptography version. * Improve error message. * Update documentation.
This commit is contained in:
@@ -305,9 +305,7 @@ def openssl_csr_info_filter(data, name_encoding="ignore"):
|
||||
|
||||
module = FilterModuleMock({"name_encoding": name_encoding})
|
||||
try:
|
||||
return get_csr_info(
|
||||
module, "cryptography", content=to_bytes(data), validate_signature=True
|
||||
)
|
||||
return get_csr_info(module, content=to_bytes(data), validate_signature=True)
|
||||
except OpenSSLObjectError as exc:
|
||||
raise AnsibleFilterError(str(exc))
|
||||
|
||||
|
||||
@@ -181,7 +181,6 @@ def openssl_privatekey_info_filter(
|
||||
try:
|
||||
result = get_privatekey_info(
|
||||
module,
|
||||
"cryptography",
|
||||
content=to_bytes(data),
|
||||
passphrase=passphrase,
|
||||
return_private_key_data=return_private_key_data,
|
||||
|
||||
@@ -146,7 +146,7 @@ def openssl_publickey_info_filter(data):
|
||||
|
||||
module = FilterModuleMock({})
|
||||
try:
|
||||
return get_publickey_info(module, "cryptography", content=to_bytes(data))
|
||||
return get_publickey_info(module, content=to_bytes(data))
|
||||
except PublicKeyParseError as exc:
|
||||
raise AnsibleFilterError(exc.error_message)
|
||||
except OpenSSLObjectError as exc:
|
||||
|
||||
@@ -339,7 +339,7 @@ def x509_certificate_info_filter(data, name_encoding="ignore"):
|
||||
|
||||
module = FilterModuleMock({"name_encoding": name_encoding})
|
||||
try:
|
||||
return get_certificate_info(module, "cryptography", content=to_bytes(data))
|
||||
return get_certificate_info(module, content=to_bytes(data))
|
||||
except OpenSSLObjectError as exc:
|
||||
raise AnsibleFilterError(str(exc))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user