Udostępnij za pośrednictwem


SignedCms.Decode Metoda

Definicja

Przeciążenia

Decode(Byte[])

Dekoduje zakodowany SignedCms komunikat.

Decode(ReadOnlySpan<Byte>)

Decode(Byte[])

Źródło:
SignedCms.cs
Źródło:
SignedCms.cs
Źródło:
SignedCms.cs
Źródło:
SignedCms.cs

Dekoduje zakodowany SignedCms komunikat.

public:
 void Decode(cli::array <System::Byte> ^ encodedMessage);
public void Decode (byte[] encodedMessage);
member this.Decode : byte[] -> unit
Public Sub Decode (encodedMessage As Byte())

Parametry

encodedMessage
Byte[]

Tablica wartości bajtów reprezentująca zakodowany komunikat CMS/PKCS#7 do dekodowania.

Wyjątki

encodedMessage to null.

encodedMessage nie można pomyślnie dekodować.

Przykłady

W poniższym przykładzie pokazano umieszczenie Decode metody w procesie weryfikowania podpisów w SignedCms komunikacie. W tym przykładzie zawartość wiadomości nie jest odłączona, więc zawartość wiadomości jest dołączona do SignedCms wiadomości.

// 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)

W poniższym przykładzie pokazano umieszczenie Decode metody w procesie weryfikowania podpisów w SignedCms komunikacie. W tym przykładzie zawartość komunikatu jest odłączona, więc zawartość wiadomości musi zostać zweryfikowana niezależnie od komunikatu 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)

Uwagi

Ta metoda resetuje wszystkie zmienne składowe obiektu przy użyciu informacji uzyskanych z pomyślnego dekodowania.

Zobacz też

Dotyczy

Decode(ReadOnlySpan<Byte>)

Źródło:
SignedCms.cs
Źródło:
SignedCms.cs
Źródło:
SignedCms.cs
Źródło:
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))

Parametry

encodedMessage
ReadOnlySpan<Byte>

Zakres wartości bajtów tylko do odczytu reprezentujący zakodowany komunikat CMS/PKCS#7 do dekodowania.

Wyjątki

encodedMessage nie można pomyślnie dekodować.

Zobacz też

Dotyczy