# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities

__all__ = [
    'GetVerifyResult',
    'AwaitableGetVerifyResult',
    'get_verify',
    'get_verify_output',
]

@pulumi.output_type
class GetVerifyResult:
    """
    A collection of values returned by getVerify.
    """
    def __init__(__self__, digest=None, id=None, key_id=None, region=None, signature=None, valid=None):
        if digest and not isinstance(digest, str):
            raise TypeError("Expected argument 'digest' to be a str")
        pulumi.set(__self__, "digest", digest)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if key_id and not isinstance(key_id, str):
            raise TypeError("Expected argument 'key_id' to be a str")
        pulumi.set(__self__, "key_id", key_id)
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        pulumi.set(__self__, "region", region)
        if signature and not isinstance(signature, str):
            raise TypeError("Expected argument 'signature' to be a str")
        pulumi.set(__self__, "signature", signature)
        if valid and not isinstance(valid, bool):
            raise TypeError("Expected argument 'valid' to be a bool")
        pulumi.set(__self__, "valid", valid)

    @_builtins.property
    @pulumi.getter
    def digest(self) -> _builtins.str:
        return pulumi.get(self, "digest")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="keyId")
    def key_id(self) -> _builtins.str:
        return pulumi.get(self, "key_id")

    @_builtins.property
    @pulumi.getter
    def region(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "region")

    @_builtins.property
    @pulumi.getter
    def signature(self) -> _builtins.str:
        return pulumi.get(self, "signature")

    @_builtins.property
    @pulumi.getter
    def valid(self) -> _builtins.bool:
        return pulumi.get(self, "valid")


class AwaitableGetVerifyResult(GetVerifyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetVerifyResult(
            digest=self.digest,
            id=self.id,
            key_id=self.key_id,
            region=self.region,
            signature=self.signature,
            valid=self.valid)


def get_verify(digest: Optional[_builtins.str] = None,
               key_id: Optional[_builtins.str] = None,
               region: Optional[_builtins.str] = None,
               signature: Optional[_builtins.str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVerifyResult:
    """
    The `keymanager_get_verify` data source is used to verify a message signature against a message digest with a given key. The key must have its usage set to asymmetric_signing. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration, and encoded as a base64 string.

    Refer to the Key Manager [documentation](https://www.scaleway.com/en/docs/key-manager/) and [API documentation](https://www.scaleway.com/en/developers/api/key-manager/) for more information.


    :param _builtins.str digest: Digest of the original signed message. Must be generated using the same algorithm specified in the key’s configuration, and encoded as a base64 string.
    :param _builtins.str key_id: ID of the key to use for signature verification. Can be a plain UUID or a regional ID.
    :param _builtins.str region: The region of the key. If not set, the region is derived from the key_id when possible or from the provider `region` configuration.
    :param _builtins.str signature: The message signature to verify, encoded as a base64 string.
    """
    __args__ = dict()
    __args__['digest'] = digest
    __args__['keyId'] = key_id
    __args__['region'] = region
    __args__['signature'] = signature
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:keymanager/getVerify:getVerify', __args__, opts=opts, typ=GetVerifyResult).value

    return AwaitableGetVerifyResult(
        digest=pulumi.get(__ret__, 'digest'),
        id=pulumi.get(__ret__, 'id'),
        key_id=pulumi.get(__ret__, 'key_id'),
        region=pulumi.get(__ret__, 'region'),
        signature=pulumi.get(__ret__, 'signature'),
        valid=pulumi.get(__ret__, 'valid'))
def get_verify_output(digest: Optional[pulumi.Input[_builtins.str]] = None,
                      key_id: Optional[pulumi.Input[_builtins.str]] = None,
                      region: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                      signature: Optional[pulumi.Input[_builtins.str]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetVerifyResult]:
    """
    The `keymanager_get_verify` data source is used to verify a message signature against a message digest with a given key. The key must have its usage set to asymmetric_signing. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration, and encoded as a base64 string.

    Refer to the Key Manager [documentation](https://www.scaleway.com/en/docs/key-manager/) and [API documentation](https://www.scaleway.com/en/developers/api/key-manager/) for more information.


    :param _builtins.str digest: Digest of the original signed message. Must be generated using the same algorithm specified in the key’s configuration, and encoded as a base64 string.
    :param _builtins.str key_id: ID of the key to use for signature verification. Can be a plain UUID or a regional ID.
    :param _builtins.str region: The region of the key. If not set, the region is derived from the key_id when possible or from the provider `region` configuration.
    :param _builtins.str signature: The message signature to verify, encoded as a base64 string.
    """
    __args__ = dict()
    __args__['digest'] = digest
    __args__['keyId'] = key_id
    __args__['region'] = region
    __args__['signature'] = signature
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:keymanager/getVerify:getVerify', __args__, opts=opts, typ=GetVerifyResult)
    return __ret__.apply(lambda __response__: GetVerifyResult(
        digest=pulumi.get(__response__, 'digest'),
        id=pulumi.get(__response__, 'id'),
        key_id=pulumi.get(__response__, 'key_id'),
        region=pulumi.get(__response__, 'region'),
        signature=pulumi.get(__response__, 'signature'),
        valid=pulumi.get(__response__, 'valid')))
