# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from . import EncryptionAlgorithm, KeyWrapAlgorithm, SignatureAlgorithm
[docs]class DecryptResult:
"""The result of a decrypt operation.
:param str key_id: The encryption key's Key Vault identifier
:param algorithm: The encryption algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.EncryptionAlgorithm
:param bytes plaintext: The decrypted bytes
"""
def __init__(self, key_id, algorithm, plaintext):
# type: (str, str, EncryptionAlgorithm, bytes) -> None
self.key_id = key_id
self.algorithm = algorithm
self.plaintext = plaintext
[docs]class EncryptResult:
"""The result of an encrypt operation.
:param str key_id: The encryption key's Key Vault identifier
:param algorithm: The encryption algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.EncryptionAlgorithm
:param bytes ciphertext: The encrypted bytes
"""
def __init__(self, key_id, algorithm, ciphertext):
# type: (str, EncryptionAlgorithm, bytes) -> None
self.key_id = key_id
self.algorithm = algorithm
self.ciphertext = ciphertext
[docs]class SignResult:
"""The result of a sign operation.
:param str key_id: The signing key's Key Vault identifier
:param algorithm: The signature algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.SignatureAlgorithm
:param bytes signature:
"""
def __init__(self, key_id, algorithm, signature):
# type: (str, SignatureAlgorithm, bytes) -> None
self.key_id = key_id
self.algorithm = algorithm
self.signature = signature
[docs]class VerifyResult:
"""The result of a verify operation.
:param str key_id: The signing key's Key Vault identifier
:param bool is_valid: Whether the signature is valid
:param algorithm: The signature algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.SignatureAlgorithm
"""
def __init__(self, key_id, is_valid, algorithm):
# type: (str, bool, SignatureAlgorithm) -> None
self.key_id = key_id
self.is_valid = is_valid
self.algorithm = algorithm
[docs]class UnwrapResult:
"""The result of an unwrap key operation.
:param str key_id: Key encryption key's Key Vault identifier
:param algorithm: The key wrap algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.KeyWrapAlgorithm
:param bytes key: The unwrapped key
"""
def __init__(self, key_id, algorithm, key):
# type: (str, KeyWrapAlgorithm, bytes) -> None
self.key_id = key_id
self.algorithm = algorithm
self.key = key
[docs]class WrapResult:
"""The result of a wrap key operation.
:param str key_id: The wrapping key's Key Vault identifier
:param algorithm: The key wrap algorithm used
:type algorithm: ~azure.keyvault.keys.crypto.KeyWrapAlgorithm
:param bytes encrypted_key: The encrypted key bytes
"""
def __init__(self, key_id, algorithm, encrypted_key):
# type: (str, KeyWrapAlgorithm, bytes) -> None
self.key_id = key_id
self.algorithm = algorithm
self.encrypted_key = encrypted_key