SignedCms.Decode(Byte[]) 메서드

정의

인코딩된 메시지를 디코딩합니다 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 메시지를 나타내는 바이트 값의 배열입니다.

예외

encodedMessagenull입니다.

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)

설명

이 메서드는 성공적으로 디코딩에서 얻은 정보를 사용하여 개체의 모든 멤버 변수를 다시 설정합니다.

적용 대상

추가 정보