mirror of
https://github.com/openkmip/pykmip
synced 2025-12-14 15:23:27 +00:00
Add ProxyKmipClient demos for the Encrypt / Decrypt operations
This change adds demos for the ProxyKmipClient, demonstrating how to encrypt and decrypt messages. Demo utilities have been updated to support the new demo scripts and the KMIPProxy client has been updated to correctly return operation results.
This commit is contained in:
@@ -240,6 +240,36 @@ def build_cli_parser(operation=None):
|
||||
default=None,
|
||||
dest="algorithm",
|
||||
help="Encryption algorithm for the secret (e.g., AES)")
|
||||
elif operation is Operation.ENCRYPT:
|
||||
parser.add_option(
|
||||
"-m",
|
||||
"--message",
|
||||
action="store",
|
||||
type="str",
|
||||
default="This is a secret message.",
|
||||
dest="message",
|
||||
help="The message to encrypt."
|
||||
)
|
||||
elif operation is Operation.DECRYPT:
|
||||
parser.add_option(
|
||||
"-i",
|
||||
"--uuid",
|
||||
action="store",
|
||||
type="str",
|
||||
default=None,
|
||||
dest="uuid",
|
||||
help="The unique ID of the decryption key to use to decrypt the "
|
||||
"cipher text."
|
||||
)
|
||||
parser.add_option(
|
||||
"-m",
|
||||
"--message",
|
||||
action="store",
|
||||
type="str",
|
||||
default=None,
|
||||
dest="message",
|
||||
help="The cipher text to decrypt."
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user