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

CryptographyClient.Sign(SignatureAlgorithm, Byte[], CancellationToken) 方法

定义

对指定的摘要进行签名。

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

参数

algorithm
SignatureAlgorithm

要使用的 SignatureAlgorithm

digest
Byte[]

要签名的预哈希摘要。 用于计算摘要的哈希算法必须与指定的算法兼容。

cancellationToken
CancellationToken

用于取消此操作的 CancellationToken

返回

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

例外

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

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

密钥对于当前操作无效。

指定键不支持该操作。

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

适用于