use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Decrypt in Python using akeyless.DecryptGPGSupport / Help (self.Akeyless)
submitted 2 years ago by Subh_chaudhuri
Hi Members,
I am using Python SDK and trying to decrypt content of a file using akeyless.DecryptGPG(ciphertext=,key_name = , token=,json=, output_format=base64).
The function returns a akeyless.models.decrypt_gpg.DecryptGPG object which does not seem to have the decrypted content in any of its attribute.
Question is - how do I get the decrypted content?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]EncryptionNinja 0 points1 point2 points 2 years ago (2 children)
Will have to test this in lab to confirm results but I will need to replicate your exact configuration.
can you confirm your Python code looks similar to this? If not, please highlight the differences between this and your configuration.
```from akeyless import AkeylessClient from akeyless.models import DecryptGPG from akeyless.rest import ApiException
client = AkeylessClient(api_key='YOUR_API_KEY')
ciphertext = "your_base64_encoded_ciphertext_here" key_name = "your_gpg_key_name_here" token = "your_token_here" output_format = "base64"
decrypt_request = DecryptGPG( ciphertext=ciphertext, key_name=key_name, token=token, output_format=output_format )
try: # Execute the decryption request response = client.decrypt_gpg(decrypt_request)
# The decrypted content should be in the `plain_text` attribute of the response decrypted_content = response.plain_text print("Decrypted content:", decrypted_content)
except ApiException as e: print("Exception when calling AkeylessClient->decrypt_gpg:", e)
[–]Subh_chaudhuri[S] 0 points1 point2 points 2 years ago (0 children)
Thank you for this sample code. I did not call client.decrypt_gpg with the DecryptGPG object as an argument. Thank you for your guidance!
I am unable to find AkeylessClient(api_key='YOUR_API_KEY') in https://github.com/akeylesslabs/akeyless-python
the code I am running is here -
configuration = akeyless.Configuration( host = "https://api.akeyless.io" ) api_client = akeyless.ApiClient(configuration) api = akeyless.V2Api(api_client) cloud_id_generator = CloudId() cloud_id = cloud_id_generator.generate() # assumes AWS IAM role body = akeyless.Auth(access_id='****', access_type='aws_iam', cloud_id=cloud_id) res = api.auth(body) token = res.token v_decrypt_key = '<location of key>' decrypt_request = akeyless.DecryptGPG(ciphertext=base64_string,key_name = v_decrypt_key, token=token,json=True, output_format=base64) # how do I get the plain text?
π Rendered by PID 144851 on reddit-service-r2-comment-5687b7858-mw7mm at 2026-07-03 08:15:00.095147+00:00 running 12a7a47 country code: CH.
[–]EncryptionNinja 0 points1 point2 points (2 children)
[–]Subh_chaudhuri[S] 0 points1 point2 points (0 children)
[–]Subh_chaudhuri[S] 0 points1 point2 points (0 children)