2
0
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:
Peter Hamilton
2017-08-15 11:03:20 -04:00
parent 5758c6dd1e
commit b0d454da9a
5 changed files with 230 additions and 8 deletions

View File

@@ -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