你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CryptographyClient.SignData 方法

定义

重载

SignData(SignatureAlgorithm, Byte[], CancellationToken)

签署指定数据。

SignData(SignatureAlgorithm, Stream, CancellationToken)

签署指定数据。

SignData(SignatureAlgorithm, Byte[], CancellationToken)

签署指定数据。

public virtual Azure.Security.KeyVault.Keys.Cryptography.SignResult SignData (Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm algorithm, byte[] data, System.Threading.CancellationToken cancellationToken = default);
abstract member SignData : Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm * byte[] * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.SignResult
override this.SignData : Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm * byte[] * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.SignResult
Public Overridable Function SignData (algorithm As SignatureAlgorithm, data As Byte(), Optional cancellationToken As CancellationToken = Nothing) As SignResult

参数

algorithm
SignatureAlgorithm

要使用的 SignatureAlgorithm

data
Byte[]

要签名的数据。

cancellationToken
CancellationToken

用于取消此操作的 CancellationToken

返回

签名操作的结果。 返回的 SignResult 包含签名以及验证签名所需的所有其他信息。 此信息应随签名一起存储。

例外

指定的 algorithm 与密钥标识符对应的密钥不匹配。

本地加密提供程序引发异常。

密钥对于当前操作无效。

指定键不支持该操作。

服务器返回错误。 有关从服务器返回的详细信息,请参阅 Message

注解

用于计算摘要的哈希算法派生自指定的算法:

适用于

SignData(SignatureAlgorithm, Stream, CancellationToken)

签署指定数据。

public virtual Azure.Security.KeyVault.Keys.Cryptography.SignResult SignData (Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm algorithm, System.IO.Stream data, System.Threading.CancellationToken cancellationToken = default);
abstract member SignData : Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm * System.IO.Stream * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.SignResult
override this.SignData : Azure.Security.KeyVault.Keys.Cryptography.SignatureAlgorithm * System.IO.Stream * System.Threading.CancellationToken -> Azure.Security.KeyVault.Keys.Cryptography.SignResult
Public Overridable Function SignData (algorithm As SignatureAlgorithm, data As Stream, Optional cancellationToken As CancellationToken = Nothing) As SignResult

参数

algorithm
SignatureAlgorithm

要使用的 SignatureAlgorithm

data
Stream

要签名的数据。

cancellationToken
CancellationToken

用于取消此操作的 CancellationToken

返回

签名操作的结果。 返回的 SignResult 包含签名以及验证签名所需的所有其他信息。 此信息应随签名一起存储。

例外

指定的 algorithm 与密钥标识符对应的密钥不匹配。

data 为 null。

本地加密提供程序引发异常。

密钥对于当前操作无效。

指定键不支持该操作。

服务器返回错误。 有关从服务器返回的详细信息,请参阅 Message

注解

用于计算摘要的哈希算法派生自指定的算法:

适用于