public async Task SignAsync()

in Notation.Plugin.AzureKeyVault/KeyVault/KeyVaultClient.cs [156:171]


        public async Task<byte[]> SignAsync(SignatureAlgorithm algorithm, byte[] payload)
        {
            var signResult = await _cryptoClient.Value.SignDataAsync(algorithm, payload);

            if (!string.IsNullOrEmpty(_version) && signResult.KeyId != _keyId)
            {
                throw new PluginException($"Invalid key identifier. User required {_keyId} does not match {signResult.KeyId} in response. Please ensure the provided key identifier is correct.");
            }

            if (signResult.Algorithm != algorithm)
            {
                throw new PluginException($"Invalid signature algorithm. The user provides {algorithm} but the response contains {signResult.Algorithm} as the algorithm");
            }

            return signResult.Signature;
        }