CoseSignature.VerifyDetached Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[]) |
Verifies that the signature is valid for the message's content using the specified key. |
| VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the message's content using the specified key. |
| VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the message's content using the specified key. |
| VerifyDetached(CoseKey, Byte[], Byte[]) |
Verifies that the signature is valid for the message's content using the specified key. |
| VerifyDetached(CoseKey, Stream, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the message's content using the specified key. |
| VerifyDetached(CoseKey, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the message's content using the specified key. |
VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
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
Parameters
The private key used to sign the content.
- detachedContent
- Byte[]
The content that was previously signed.
- associatedData
- Byte[]
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key or detachedContent is null.
key is of an unsupported type.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.
See also
Applies to
VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>)
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
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
Parameters
The private key used to sign the content.
- detachedContent
- Stream
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key or detachedContent is null.
key is of an unsupported type.
-or-
detachedContent does not support reading or seeking.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.
See also
Applies to
VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
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
Parameters
The private key used to sign the content.
- detachedContent
- ReadOnlySpan<Byte>
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key is null.
key is of an unsupported type.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.
See also
Applies to
VerifyDetached(CoseKey, Byte[], Byte[])
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
public bool VerifyDetached(System.Security.Cryptography.Cose.CoseKey key, byte[] detachedContent, byte[]? associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.Cose.CoseKey * byte[] * byte[] -> bool
Public Function VerifyDetached (key As CoseKey, detachedContent As Byte(), Optional associatedData As Byte() = Nothing) As Boolean
Parameters
- key
- CoseKey
The private key used to sign the content.
- detachedContent
- Byte[]
The content that was previously signed.
- associatedData
- Byte[]
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key or detachedContent is null.
key is of an unsupported type.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.
See also
Applies to
VerifyDetached(CoseKey, Stream, ReadOnlySpan<Byte>)
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
public bool VerifyDetached(System.Security.Cryptography.Cose.CoseKey key, System.IO.Stream detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.Cose.CoseKey * System.IO.Stream * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As CoseKey, detachedContent As Stream, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
- key
- CoseKey
The private key used to sign the content.
- detachedContent
- Stream
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key or detachedContent is null.
key is of an unsupported type.
-or-
detachedContent does not support reading or seeking.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.
See also
Applies to
VerifyDetached(CoseKey, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- CoseSignature.cs
Verifies that the signature is valid for the message's content using the specified key.
public bool VerifyDetached(System.Security.Cryptography.Cose.CoseKey key, ReadOnlySpan<byte> detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.Cose.CoseKey * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As CoseKey, detachedContent As ReadOnlySpan(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
- key
- CoseKey
The private key used to sign the content.
- detachedContent
- ReadOnlySpan<Byte>
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true if the signature is valid; otherwise, false.
Exceptions
key is null.
key is of an unsupported type.
The content is embedded on the associated message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key.