CoseSign1Message.VerifyDetachedAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的密钥异步验证签名是否对内容有效。
重载
| 名称 | 说明 |
|---|---|
| VerifyDetachedAsync(AsymmetricAlgorithm, Stream, ReadOnlyMemory<Byte>, CancellationToken) |
使用指定的密钥异步验证签名是否对内容有效。 |
| VerifyDetachedAsync(CoseKey, Stream, ReadOnlyMemory<Byte>, CancellationToken) |
使用指定的密钥异步验证签名是否对内容有效。 |
VerifyDetachedAsync(AsymmetricAlgorithm, Stream, ReadOnlyMemory<Byte>, CancellationToken)
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
使用指定的密钥异步验证签名是否对内容有效。
public System.Threading.Tasks.Task<bool> VerifyDetachedAsync(System.Security.Cryptography.AsymmetricAlgorithm key, System.IO.Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, System.Threading.CancellationToken cancellationToken = default);
member this.VerifyDetachedAsync : System.Security.Cryptography.AsymmetricAlgorithm * System.IO.Stream * ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function VerifyDetachedAsync (key As AsymmetricAlgorithm, detachedContent As Stream, Optional associatedData As ReadOnlyMemory(Of Byte) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)
参数
与用于对内容进行签名的私钥关联的公钥。
- detachedContent
- Stream
以前签名的内容。
- associatedData
- ReadOnlyMemory<Byte>
与签名关联的额外数据,必须与签名期间提供的值匹配。
- cancellationToken
- CancellationToken
用于监视取消请求的令牌。 默认值为 None。
返回
其 Task<TResult> 属性为 true 如果签名有效的任务;否则为 false。
例外
key 或 detachedContent 为 null.
此消息中嵌入内容,使用使用嵌入内容的重载。
ProtectedHeaders 没有标头的值 Algorithm 。
-或-
算法保护的标头格式不正确。
-或-
受算法保护的标头不是此实现支持的值之一。
-或-
受算法保护的标头与指定的 key算法不匹配。
取消令牌已取消。 此异常存储在返回的任务中。
另请参阅
适用于
VerifyDetachedAsync(CoseKey, Stream, ReadOnlyMemory<Byte>, CancellationToken)
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
使用指定的密钥异步验证签名是否对内容有效。
public System.Threading.Tasks.Task<bool> VerifyDetachedAsync(System.Security.Cryptography.Cose.CoseKey key, System.IO.Stream detachedContent, ReadOnlyMemory<byte> associatedData = default, System.Threading.CancellationToken cancellationToken = default);
member this.VerifyDetachedAsync : System.Security.Cryptography.Cose.CoseKey * System.IO.Stream * ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function VerifyDetachedAsync (key As CoseKey, detachedContent As Stream, Optional associatedData As ReadOnlyMemory(Of Byte) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)
参数
- key
- CoseKey
与用于对内容进行签名的私钥关联的公钥。
- detachedContent
- Stream
以前签名的内容。
- associatedData
- ReadOnlyMemory<Byte>
与签名关联的额外数据,必须与签名期间提供的值匹配。
- cancellationToken
- CancellationToken
用于监视取消请求的令牌。 默认值为 None。
返回
其 Task<TResult> 属性为 true 如果签名有效的任务;否则为 false。
例外
key 或 detachedContent 为 null.
此消息中嵌入内容,使用使用嵌入内容的重载。
ProtectedHeaders 没有标头的值 Algorithm 。
-或-
算法保护的标头格式不正确。
-或-
受算法保护的标头不是此实现支持的值之一。
-或-
受算法保护的标头与指定的 key算法不匹配。