SignedCms.Decode 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Decode(Byte[]) |
解码编码 SignedCms 的消息。 |
| Decode(ReadOnlySpan<Byte>) |
Decode(Byte[])
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
解码编码 SignedCms 的消息。
public:
void Decode(cli::array <System::Byte> ^ encodedMessage);
public void Decode(byte[] encodedMessage);
member this.Decode : byte[] -> unit
Public Sub Decode (encodedMessage As Byte())
参数
- encodedMessage
- Byte[]
表示要解码的编码 CMS/PKCS#7 消息的字节值的数组。
例外
encodedMessage 是 null。
encodedMessage 无法成功解码。
示例
下面的示例演示如何在验证消息上的Decode签名的过程中放置SignedCms方法。 在此示例中,消息内容未分离,因此消息内容包含在消息中 SignedCms 。
// Create a new, nondetached SignedCms message.
SignedCms signedCms = new SignedCms();
// encodedMessage is the encoded message received from
// the sender.
signedCms.Decode(encodedMessage);
// Verify the signature without validating the
// certificate.
signedCms.CheckSignature(true);
' Create a new, nondetached SignedCms message.
Dim signedCms As New SignedCms()
' encodedMessage is the encoded message received from
' the sender.
signedCms.Decode(encodedMessage)
' Verify the signature without validating the
' certificate.
signedCms.CheckSignature(True)
下面的示例演示如何在验证消息上的Decode签名的过程中放置SignedCms方法。 在此示例中,将分离消息内容,因此消息内容必须独立于 SignedCms 消息进行验证。
// Create a ContentInfo object from the inner content obtained
// independently from encodedMessage.
ContentInfo contentInfo = new ContentInfo(innerContent);
// Create a new, detached SignedCms message.
SignedCms signedCms = new SignedCms(contentInfo, true);
// encodedMessage is the encoded message received from
// the sender.
signedCms.Decode(encodedMessage);
// Verify the signature without validating the
// certificate.
signedCms.CheckSignature(true);
' Create a ContentInfo object from the inner content obtained
' independently from encodedMessage.
Dim contentInfo As New ContentInfo(innerContent)
' Create a new, detached SignedCms message.
Dim signedCms As New SignedCms(contentInfo, True)
' encodedMessage is the encoded message received from
' the sender.
signedCms.Decode(encodedMessage)
' Verify the signature without validating the
' certificate.
signedCms.CheckSignature(True)
注解
此方法通过使用从成功解码中获取的信息重置对象的所有成员变量。
另请参阅
适用于
Decode(ReadOnlySpan<Byte>)
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
- Source:
- SignedCms.cs
public:
void Decode(ReadOnlySpan<System::Byte> encodedMessage);
public void Decode(ReadOnlySpan<byte> encodedMessage);
member this.Decode : ReadOnlySpan<byte> -> unit
Public Sub Decode (encodedMessage As ReadOnlySpan(Of Byte))
参数
- encodedMessage
- ReadOnlySpan<Byte>
字节值的只读范围,表示要解码的编码 CMS/PKCS#7 消息。
例外
encodedMessage 无法成功解码。