removed extra arguments and encrypt/decrypt section
This commit is contained in:
@@ -339,27 +339,6 @@ if __name__ == "__main__":
|
||||
dest="config",
|
||||
help="Edit configuration."
|
||||
)
|
||||
parser.add_option(
|
||||
"-d",
|
||||
"--decrypt",
|
||||
action="store_true",
|
||||
dest="decrypt",
|
||||
)
|
||||
parser.add_option(
|
||||
"-e",
|
||||
"--encrypt",
|
||||
action="store_true",
|
||||
dest="encrypt",
|
||||
)
|
||||
parser.add_option(
|
||||
"-m",
|
||||
"--message",
|
||||
action="store",
|
||||
type="str",
|
||||
default="This is a secret message.",
|
||||
dest="message",
|
||||
help="The message to encrypt."
|
||||
)
|
||||
parser.add_option (
|
||||
"-v",
|
||||
"--verbose",
|
||||
@@ -377,23 +356,6 @@ if __name__ == "__main__":
|
||||
client = client.ProxyKmipClient(config_file=pykmip_client_config_file)
|
||||
client.open()
|
||||
#print(encrypt(client, "test"))
|
||||
|
||||
if opts.encrypt:
|
||||
while True:
|
||||
passphrase = getpass.getpass("Please enter your pool/dataset unlock passphrase to encrypt: ")
|
||||
passphrase2 = getpass.getpass("Please enter the passphrase again: ")
|
||||
if passphrase == passphrase2:
|
||||
break
|
||||
else:
|
||||
print("The passphrases do not match, please try again.")
|
||||
encrypted_passphrase = encrypt(client, passphrase)
|
||||
print("Your encrypted passphrase: {}".format(encrypted_passphrase))
|
||||
sys.exit(0)
|
||||
elif opts.decrypt:
|
||||
passphrase = input("Please enter the encryted passphrase to decrypt: ")
|
||||
decrypted_passphrase = decrypt(client, passphrase)
|
||||
print("Your decrypted passphrase: {}".format(decrypted_passphrase))
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if opts.config:
|
||||
|
||||
Reference in New Issue
Block a user