CoseSign1Message.VerifyDetached 方法

定义

重载

VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])

使用指定的密钥验证签名是否对内容有效。

VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>)

使用指定的密钥验证签名是否对内容有效。

VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

使用指定的密钥验证签名是否对内容有效。

VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])

Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs

使用指定的密钥验证签名是否对内容有效。

public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, byte[] detachedContent, byte[]? associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * byte[] * byte[] -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As Byte(), Optional associatedData As Byte() = Nothing) As Boolean

参数

key
AsymmetricAlgorithm

与用于对内容进行签名的私钥关联的公钥。

detachedContent
Byte[]

以前签名的内容。

associatedData
Byte[]

与签名关联的额外数据,该数据必须与签名期间提供的值匹配。

返回

如果签名有效,则为 true;否则为 false

例外

keydetachedContentnull

key 属于不受支持的类型。

内容嵌入在此消息中,使用使用嵌入内容的重载。

ProtectedHeaders 没有 标头的值 Algorithm

-或-

算法保护标头的格式不正确。

-或-

算法保护标头不是此实现支持的值之一。

-或-

算法保护标头与指定的 key支持的算法不匹配。

适用于

VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>)

Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs

使用指定的密钥验证签名是否对内容有效。

public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, System.IO.Stream detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * System.IO.Stream * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As Stream, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean

参数

key
AsymmetricAlgorithm

与用于对内容进行签名的私钥关联的公钥。

detachedContent
Stream

以前签名的内容。

associatedData
ReadOnlySpan<Byte>

与签名关联的额外数据,该数据必须与签名期间提供的值匹配。

返回

如果签名有效,则为 true;否则为 false

例外

keydetachedContentnull

key 属于不受支持的类型。

-或-

detachedContent 不支持阅读或查找。

内容嵌入在此消息中,使用使用嵌入内容的重载。

ProtectedHeaders 没有 标头的值 Algorithm

-或-

算法保护标头的格式不正确。

-或-

算法保护标头不是此实现支持的值之一。

-或-

算法保护标头与指定的 key支持的算法不匹配。

适用于

VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs
Source:
CoseSign1Message.cs

使用指定的密钥验证签名是否对内容有效。

public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, ReadOnlySpan<byte> detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As ReadOnlySpan(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean

参数

key
AsymmetricAlgorithm

与用于对内容进行签名的私钥关联的公钥。

detachedContent
ReadOnlySpan<Byte>

以前签名的内容。

associatedData
ReadOnlySpan<Byte>

与签名关联的额外数据,该数据必须与签名期间提供的值匹配。

返回

如果签名有效,则为 true;否则为 false

例外

keynull

key 属于不受支持的类型。

内容嵌入在此消息中,使用使用嵌入内容的重载。

ProtectedHeaders 没有 标头的值 Algorithm

-或-

算法保护标头的格式不正确。

-或-

算法保护标头不是此实现支持的值之一。

-或-

算法保护标头与指定的 key支持的算法不匹配。

适用于