SignedXml Klasse

Definition

Stellt einen Wrapper für ein grundlegendes XML-Signaturobjekt bereit, um das Erstellen von XML-Signaturen zu vereinfachen.

public ref class SignedXml
public class SignedXml
type SignedXml = class
Public Class SignedXml
Vererbung
SignedXml

Beispiele

Im folgenden Codebeispiel wird gezeigt, wie Sie ein gesamtes XML-Dokument mithilfe einer umschlagierten Signatur signieren und überprüfen.

//
// This example signs an XML file using an
// envelope signature. It then verifies the 
// signed XML.
//
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Xml;

public class SignVerifyEnvelope
{

    public static void Main(String[] args)
    {
        try
        {
           // Generate a signing key.
           RSA Key = RSA.Create();

           // Create an XML file to sign.
           CreateSomeXml("Example.xml");
           Console.WriteLine("New XML file created."); 

           // Sign the XML that was just created and save it in a 
           // new file.
           SignXmlFile("Example.xml", "signedExample.xml", Key);
           Console.WriteLine("XML file signed."); 

           // Verify the signature of the signed XML.
           Console.WriteLine("Verifying signature...");
           bool result = VerifyXmlFile("SignedExample.xml", Key);

           // Display the results of the signature verification to 
           // the console.
           if(result)
           {
               Console.WriteLine("The XML signature is valid.");
           }
           else
           {
            Console.WriteLine("The XML signature is not valid.");
           }
        }
        catch(CryptographicException e)
        {
            Console.WriteLine(e.Message);
        }
    }

    // Sign an XML file and save the signature in a new file. This method does not  
    // save the public key within the XML file.  This file cannot be verified unless  
    // the verifying code has the key with which it was signed.
    public static void SignXmlFile(string FileName, string SignedFileName, RSA Key)
    {
        // Create a new XML document.
        XmlDocument doc = new XmlDocument();

        // Load the passed XML file using its name.
        doc.Load(new XmlTextReader(FileName));

        // Create a SignedXml object.
        SignedXml signedXml = new SignedXml(doc);

        // Add the key to the SignedXml document. 
        signedXml.SigningKey = Key;

        // Create a reference to be signed.
        Reference reference = new Reference();
        reference.Uri = "";

        // Add an enveloped transformation to the reference.
        XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform();
        reference.AddTransform(env);

        // Add the reference to the SignedXml object.
        signedXml.AddReference(reference);

        // Compute the signature.
        signedXml.ComputeSignature();

        // Get the XML representation of the signature and save
        // it to an XmlElement object.
        XmlElement xmlDigitalSignature = signedXml.GetXml();

        // Append the element to the XML document.
        doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true));
        
        if (doc.FirstChild is XmlDeclaration)  
        {
            doc.RemoveChild(doc.FirstChild);
        }

        // Save the signed XML document to a file specified
        // using the passed string.
        XmlTextWriter xmltw = new XmlTextWriter(SignedFileName, new UTF8Encoding(false));
        doc.WriteTo(xmltw);
        xmltw.Close();
    }

    // Verify the signature of an XML file against an asymmetric 
    // algorithm and return the result.
    public static Boolean VerifyXmlFile(String Name, RSA Key)
    {
        // Create a new XML document.
        XmlDocument xmlDocument = new XmlDocument();

        // Load the passed XML file into the document. 
        xmlDocument.Load(Name);

        // Create a new SignedXml object and pass it
        // the XML document class.
        SignedXml signedXml = new SignedXml(xmlDocument);

        // Find the "Signature" node and create a new
        // XmlNodeList object.
        XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature");

        // Load the signature node.
        signedXml.LoadXml((XmlElement)nodeList[0]);

        // Check the signature and return the result.
        return signedXml.CheckSignature(Key);
    }

    // Create example data to sign.
    public static void CreateSomeXml(string FileName)
    {
        // Create a new XmlDocument object.
        XmlDocument document = new XmlDocument();

        // Create a new XmlNode object.
        XmlNode  node = document.CreateNode(XmlNodeType.Element, "", "MyElement", "samples");
        
        // Add some text to the node.
        node.InnerText = "Example text to be signed.";

        // Append the node to the document.
        document.AppendChild(node);

        // Save the XML document to the file name specified.
        XmlTextWriter xmltw = new XmlTextWriter(FileName, new UTF8Encoding(false));
        document.WriteTo(xmltw);
        xmltw.Close();
    }
}
'
' This example signs an XML file using an
' envelope signature. It then verifies the 
' signed XML.
'
Imports System.Security.Cryptography
Imports System.Security.Cryptography.X509Certificates
Imports System.Security.Cryptography.Xml
Imports System.Text
Imports System.Xml



Public Class SignVerifyEnvelope
   
   Overloads Public Shared Sub Main(args() As [String])
      Try
         ' Generate a signing key.
         Dim Key As RSA = RSA.Create()
         
         ' Create an XML file to sign.
         CreateSomeXml("Example.xml")
         Console.WriteLine("New XML file created.")
         
         ' Sign the XML that was just created and save it in a 
         ' new file.
         SignXmlFile("Example.xml", "signedExample.xml", Key)
         Console.WriteLine("XML file signed.")
         
         ' Verify the signature of the signed XML.
         Console.WriteLine("Verifying signature...")
         Dim result As Boolean = VerifyXmlFile("SignedExample.xml", Key)
         
         ' Display the results of the signature verification to 
         ' the console.
         If result Then
            Console.WriteLine("The XML signature is valid.")
         Else
            Console.WriteLine("The XML signature is not valid.")
         End If
      Catch e As CryptographicException
         Console.WriteLine(e.Message)
      End Try
   End Sub 
   
   
   
   ' Sign an XML file and save the signature in a new file. This method does not  
   ' save the public key within the XML file.  This file cannot be verified unless  
   ' the verifying code has the key with which it was signed.
   Public Shared Sub SignXmlFile(FileName As String, SignedFileName As String, Key As RSA)
      ' Create a new XML document.
      Dim doc As New XmlDocument()
      
      ' Load the passed XML file using its name.
      doc.Load(New XmlTextReader(FileName))
      
      ' Create a SignedXml object.
      Dim signedXml As New SignedXml(doc)
      
      ' Add the key to the SignedXml document. 
      signedXml.SigningKey = Key
      
      ' Create a reference to be signed.
      Dim reference As New Reference()
      reference.Uri = ""
      
      ' Add an enveloped transformation to the reference.
      Dim env As New XmlDsigEnvelopedSignatureTransform()
      reference.AddTransform(env)
      
      ' Add the reference to the SignedXml object.
      signedXml.AddReference(reference)
      
      ' Compute the signature.
      signedXml.ComputeSignature()
      
      ' Get the XML representation of the signature and save
      ' it to an XmlElement object.
      Dim xmlDigitalSignature As XmlElement = signedXml.GetXml()
      
      ' Append the element to the XML document.
      doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, True))
      
      If TypeOf doc.FirstChild Is XmlDeclaration Then
         doc.RemoveChild(doc.FirstChild)
      End If
      
      ' Save the signed XML document to a file specified
      ' using the passed string.
      Dim xmltw As New XmlTextWriter(SignedFileName, New UTF8Encoding(False))
      doc.WriteTo(xmltw)
      xmltw.Close()
   End Sub
   
   
   ' Verify the signature of an XML file against an asymmetric 
   ' algorithm and return the result.
   Public Shared Function VerifyXmlFile(Name As [String], Key As RSA) As [Boolean]
      ' Create a new XML document.
      Dim xmlDocument As New XmlDocument()
      
      ' Load the passed XML file into the document. 
      xmlDocument.Load(Name)
      
      ' Create a new SignedXml object and pass it
      ' the XML document class.
      Dim signedXml As New SignedXml(xmlDocument)
      
      ' Find the "Signature" node and create a new
      ' XmlNodeList object.
      Dim nodeList As XmlNodeList = xmlDocument.GetElementsByTagName("Signature")
      
      ' Load the signature node.
      signedXml.LoadXml(CType(nodeList(0), XmlElement))
      
      ' Check the signature and return the result.
      Return signedXml.CheckSignature(Key)
   End Function 
   
   
   
   ' Create example data to sign.
   Public Shared Sub CreateSomeXml(FileName As String)
      ' Create a new XmlDocument object.
      Dim document As New XmlDocument()
      
      ' Create a new XmlNode object.
      Dim node As XmlNode = document.CreateNode(XmlNodeType.Element, "", "MyElement", "samples")
      
      ' Add some text to the node.
      node.InnerText = "Example text to be signed."
      
      ' Append the node to the document.
      document.AppendChild(node)
      
      ' Save the XML document to the file name specified.
      Dim xmltw As New XmlTextWriter(FileName, New UTF8Encoding(False))
      document.WriteTo(xmltw)
      xmltw.Close()
   End Sub 
End Class

Im folgenden Codebeispiel wird gezeigt, wie sie ein einzelnes Element eines XML-Dokuments mithilfe einer abgeschrägten Signatur signieren und überprüfen.

//
// This example signs an XML file using an
// envelope signature. It then verifies the
// signed XML.
//
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Xml;

public class SignVerifyEnvelope
{

    public static void Main(String[] args)
    {
        // Generate a signing key.
       RSA Key = RSA.Create();

       try
       {
           // Specify an element to sign.
           string[] elements =  { "#tag1" };

           // Sign an XML file and save the signature to a
           // new file.
           SignXmlFile("Test.xml", "SignedExample.xml", Key, elements);
           Console.WriteLine("XML file signed.");

           // Verify the signature of the signed XML.
           Console.WriteLine("Verifying signature...");

           bool result = VerifyXmlFile("SignedExample.xml");

           // Display the results of the signature verification to
           // the console.
           if (result)
           {
               Console.WriteLine("The XML signature is valid.");
           }
           else
           {
               Console.WriteLine("The XML signature is not valid.");
           }
       }
       catch (CryptographicException e)
       {
           Console.WriteLine(e.Message);
       }
       finally
       {
           // Clear resources associated with the
           // RSA instance.
           Key.Clear();
       }
   }

    // Sign an XML file and save the signature in a new file.
    public static void SignXmlFile(string FileName, string SignedFileName, RSA Key, string[] ElementsToSign)
    {
        // Check the arguments.
        if (FileName == null)
            throw new ArgumentNullException("FileName");
        if (SignedFileName == null)
            throw new ArgumentNullException("SignedFileName");
        if (Key == null)
            throw new ArgumentNullException("Key");
        if (ElementsToSign == null)
            throw new ArgumentNullException("ElementsToSign");

        // Create a new XML document.
        XmlDocument doc = new XmlDocument();

        // Format the document to ignore white spaces.
        doc.PreserveWhitespace = false;

        // Load the passed XML file using it's name.
        doc.Load(new XmlTextReader(FileName));

        // Create a SignedXml object.
        SignedXml signedXml = new SignedXml(doc);

        // Add the key to the SignedXml document.
        signedXml.SigningKey = Key;

        // Loop through each passed element to sign
        // and create a reference.
        foreach (string s in ElementsToSign)
        {
            // Create a reference to be signed.
            Reference reference = new Reference();
            reference.Uri = s;

            // Add an enveloped transformation to the reference.
            XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform();
            reference.AddTransform(env);

            // Add the reference to the SignedXml object.
            signedXml.AddReference(reference);
        }

        // Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate).
        KeyInfo keyInfo = new KeyInfo();
        keyInfo.AddClause(new RSAKeyValue((RSA)Key));
        signedXml.KeyInfo = keyInfo;

        // Compute the signature.
        signedXml.ComputeSignature();

        // Get the XML representation of the signature and save
        // it to an XmlElement object.
        XmlElement xmlDigitalSignature = signedXml.GetXml();

        // Append the element to the XML document.
        doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true));

        if (doc.FirstChild is XmlDeclaration)
        {
            doc.RemoveChild(doc.FirstChild);
        }

        // Save the signed XML document to a file specified
        // using the passed string.
        XmlTextWriter xmltw = new XmlTextWriter(SignedFileName, new UTF8Encoding(false));
        doc.WriteTo(xmltw);
        xmltw.Close();
    }
    // Verify the signature of an XML file and return the result.
    public static Boolean VerifyXmlFile(String Name)
    {
        // Check the arguments.
        if (Name == null)
            throw new ArgumentNullException("Name");

        // Create a new XML document.
        XmlDocument xmlDocument = new XmlDocument();

        // Format using white spaces.
        xmlDocument.PreserveWhitespace = true;

        // Load the passed XML file into the document.
        xmlDocument.Load(Name);

        // Create a new SignedXml object and pass it
        // the XML document class.
        SignedXml signedXml = new SignedXml(xmlDocument);

        // Find the "Signature" node and create a new
        // XmlNodeList object.
        XmlNodeList nodeList = xmlDocument.GetElementsByTagName("Signature");

        // Load the signature node.
        signedXml.LoadXml((XmlElement)nodeList[0]);

        // Check the signature and return the result.
        return signedXml.CheckSignature();
    }
}
' This example signs an XML file using an
' envelope signature. It then verifies the 
' signed XML.
'
Imports System.Security.Cryptography
Imports System.Security.Cryptography.Xml
Imports System.Text
Imports System.Xml



Module SignVerifyEnvelope



    Sub Main(ByVal args() As String)
        ' Generate a signing key.
        Dim Key As RSA = RSA.Create()

        Try
            ' Specify an element to sign. 
            Dim elements As String() = New String() {"#tag1"}

            ' Sign an XML file and save the signature to a 
            ' new file.
            SignXmlFile("Test.xml", "SignedExample.xml", Key, elements)
            Console.WriteLine("XML file signed.")

            ' Verify the signature of the signed XML.
            Console.WriteLine("Verifying signature...")

            Dim result As Boolean = VerifyXmlFile("SignedExample.xml")

            ' Display the results of the signature verification to \
            ' the console.
            If result Then
                Console.WriteLine("The XML signature is valid.")
            Else
                Console.WriteLine("The XML signature is not valid.")
            End If
        Catch e As CryptographicException
            Console.WriteLine(e.Message)
        Finally
            ' Clear resources associated with the 
            ' RSA instance.
            Key.Clear()
        End Try

    End Sub


    ' Sign an XML file and save the signature in a new file.
    Sub SignXmlFile(ByVal FileName As String, ByVal SignedFileName As String, ByVal Key As RSA, ByVal ElementsToSign() As String)
        ' Check the arguments.  
        If FileName Is Nothing Then
            Throw New ArgumentNullException("FileName")
        End If
        If SignedFileName Is Nothing Then
            Throw New ArgumentNullException("SignedFileName")
        End If
        If Key Is Nothing Then
            Throw New ArgumentNullException("Key")
        End If
        If ElementsToSign Is Nothing Then
            Throw New ArgumentNullException("ElementsToSign")
        End If
        ' Create a new XML document.
        Dim doc As New XmlDocument()

        ' Format the document to ignore white spaces.
        doc.PreserveWhitespace = False

        ' Load the passed XML file using it's name.
        doc.Load(New XmlTextReader(FileName))

        ' Create a SignedXml object.
        Dim signedXml As New SignedXml(doc)

        ' Add the key to the SignedXml document. 
        signedXml.SigningKey = Key

        ' Loop through each passed element to sign 
        ' and create a reference.
        Dim s As String
        For Each s In ElementsToSign
            ' Create a reference to be signed.
            Dim reference As New Reference()
            reference.Uri = s

            ' Add an enveloped transformation to the reference.
            Dim env As New XmlDsigEnvelopedSignatureTransform()
            reference.AddTransform(env)

            ' Add the reference to the SignedXml object.
            signedXml.AddReference(reference)
        Next s

        ' Add an RSAKeyValue KeyInfo (optional; helps recipient find key to validate).
        Dim keyInfo As New KeyInfo()
        keyInfo.AddClause(New RSAKeyValue(CType(Key, RSA)))
        signedXml.KeyInfo = keyInfo

        ' Compute the signature.
        signedXml.ComputeSignature()

        ' Get the XML representation of the signature and save
        ' it to an XmlElement object.
        Dim xmlDigitalSignature As XmlElement = signedXml.GetXml()

        ' Append the element to the XML document.
        doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, True))


        If TypeOf doc.FirstChild Is XmlDeclaration Then
            doc.RemoveChild(doc.FirstChild)
        End If

        ' Save the signed XML document to a file specified
        ' using the passed string.
        Dim xmltw As New XmlTextWriter(SignedFileName, New UTF8Encoding(False))
        doc.WriteTo(xmltw)
        xmltw.Close()

    End Sub

    ' Verify the signature of an XML file and return the result.
    Function VerifyXmlFile(ByVal Name As String) As [Boolean]
        ' Check the arguments.  
        If Name Is Nothing Then
            Throw New ArgumentNullException("Name")
        End If
        ' Create a new XML document.
        Dim xmlDocument As New XmlDocument()

        ' Format using white spaces.
        xmlDocument.PreserveWhitespace = True

        ' Load the passed XML file into the document. 
        xmlDocument.Load(Name)

        ' Create a new SignedXml object and pass it
        ' the XML document class.
        Dim signedXml As New SignedXml(xmlDocument)

        ' Find the "Signature" node and create a new
        ' XmlNodeList object.
        Dim nodeList As XmlNodeList = xmlDocument.GetElementsByTagName("Signature")

        ' Load the signature node.
        signedXml.LoadXml(CType(nodeList(0), XmlElement))

        ' Check the signature and return the result.
        Return signedXml.CheckSignature()

    End Function
End Module

Hinweise

Weitere Informationen zu dieser API finden Sie in den ergänzenden API-Hinweisen für SignedXml.

Konstruktoren

Name Beschreibung
SignedXml()

Initialisiert eine neue Instanz der SignedXml-Klasse.

SignedXml(XmlDocument)

Initialisiert eine neue Instanz der SignedXml Klasse aus dem angegebenen XML-Dokument.

SignedXml(XmlElement)

Initialisiert eine neue Instanz der SignedXml Klasse aus dem angegebenen XmlElement Objekt.

Felder

Name Beschreibung
m_signature

Stellt das Signature Objekt des aktuellen SignedXml Objekts dar.

m_strSigningKeyName

Stellt den Namen des installierten Schlüssels dar, der zum Signieren des SignedXml Objekts verwendet werden soll.

XmlDecryptionTransformUrl

Represents the Uniform Resource Identifier (URI) for the XML mode decryption transformation. Dieses Feld ist konstant.

XmlDsigBase64TransformUrl

Represents the Uniform Resource Identifier (URI) for the base 64 transformation. Dieses Feld ist konstant.

XmlDsigC14NTransformUrl

Represents the Uniform Resource Identifier (URI) for the Canonical XML transformation. Dieses Feld ist konstant.

XmlDsigC14NWithCommentsTransformUrl

Stellt den URI (Uniform Resource Identifier) für die kanonische XML-Transformation mit Kommentaren dar. Dieses Feld ist konstant.

XmlDsigCanonicalizationUrl

Stellt den URI (Uniform Resource Identifier) für den standardmäßigen Kanonisierungsalgorithmus für digitale XML-Signaturen dar. Dieses Feld ist konstant.

XmlDsigCanonicalizationWithCommentsUrl

Stellt den URI (Uniform Resource Identifier) für den standardmäßigen Kanonisierungsalgorithmus für digitale XML-Signaturen dar und enthält Kommentare. Dieses Feld ist konstant.

XmlDsigDSAUrl

Stellt den URI (Uniform Resource Identifier) für den Standardalgorithmus DSA für digitale XML-Signaturen dar. Dieses Feld ist konstant.

XmlDsigEnvelopedSignatureTransformUrl

Represents the Uniform Resource Identifier (URI) for enveloped signature transformation. Dieses Feld ist konstant.

XmlDsigExcC14NTransformUrl

Represents the Uniform Resource Identifier (URI) for exclusive XML canonicalization. Dieses Feld ist konstant.

XmlDsigExcC14NWithCommentsTransformUrl

Stellt den Uniform Resource Identifier (URI) für die exklusive XML-Kanonisierung mit Kommentaren dar. Dieses Feld ist konstant.

XmlDsigHMACSHA1Url

Stellt den URI (Uniform Resource Identifier) für den Standardalgorithmus HMACSHA1 für digitale XML-Signaturen dar. Dieses Feld ist konstant.

XmlDsigMinimalCanonicalizationUrl

Stellt den Uniform Resource Identifier (URI) für den standardmäßigen minimalen Kanonisierungsalgorithmus für digitale XML-Signaturen dar. Dieses Feld ist konstant.

XmlDsigNamespaceUrl

Represents the Uniform Resource Identifier (URI) for the standard namespace for XML digital signatures. Dieses Feld ist konstant.

XmlDsigRSASHA1Url

Represents the Uniform Resource Identifier (URI) for the standard RSA signature method for XML digital signatures. Dieses Feld ist konstant.

XmlDsigRSASHA256Url

Represents the Uniform Resource Identifier (URI) for the RSA SHA-256 signature method variation for XML digital signatures. Dieses Feld ist konstant.

XmlDsigRSASHA384Url

Represents the Uniform Resource Identifier (URI) for the RSA SHA-384 signature method variation for XML digital signatures. Dieses Feld ist konstant.

XmlDsigRSASHA512Url

Represents the Uniform Resource Identifier (URI) for the RSA SHA-512 signature method variation for XML digital signatures. Dieses Feld ist konstant.

XmlDsigSHA1Url

Represents the Uniform Resource Identifier (URI) for the standard SHA1 digest method for XML digital signatures. Dieses Feld ist konstant.

XmlDsigSHA256Url

Represents the Uniform Resource Identifier (URI) for the standard SHA256 digest method for XML digital signatures. Dieses Feld ist konstant.

XmlDsigSHA384Url

Represents the Uniform Resource Identifier (URI) for the standard SHA384 digest method for XML digital signatures. Dieses Feld ist konstant.

XmlDsigSHA512Url

Represents the Uniform Resource Identifier (URI) for the standard SHA512 digest method for XML digital signatures. Dieses Feld ist konstant.

XmlDsigXPathTransformUrl

Represents the Uniform Resource Identifier (URI) for the XML Path Language (XPath). Dieses Feld ist konstant.

XmlDsigXsltTransformUrl

Represents the Uniform Resource Identifier (URI) for XSLT transformations. Dieses Feld ist konstant.

XmlLicenseTransformUrl

Stellt den URI (Uniform Resource Identifier) für den Lizenztransformationsalgorithmus dar, der zum Normalisieren von XrML-Lizenzen für Signaturen verwendet wird.

Eigenschaften

Name Beschreibung
EncryptedXml

Dient zum Abrufen oder Festlegen eines EncryptedXml Objekts, das die XML-Verschlüsselungsverarbeitungsregeln definiert.

KeyInfo

Dient zum KeyInfo Abrufen oder Festlegen des Objekts des aktuellen SignedXml Objekts.

Resolver

Legt das aktuelle XmlResolver Objekt fest.

SafeCanonicalizationMethods

Ruft die Namen von Methoden ab, deren Kanonisierungsalgorithmen explizit zulässig sind.

Signature

Ruft das Signature Objekt des aktuellen SignedXml Objekts ab.

SignatureFormatValidator

Ruft einen Delegaten ab, der aufgerufen wird, um das Format (nicht die kryptografische Sicherheit) einer XML-Signatur zu überprüfen.

SignatureLength

Ruft die Länge der Signatur für das aktuelle SignedXml Objekt ab.

SignatureMethod

Ruft die Signaturmethode des aktuellen SignedXml Objekts ab.

SignatureValue

Ruft den Signaturwert des aktuellen SignedXml Objekts ab.

SignedInfo

Ruft das SignedInfo Objekt des aktuellen SignedXml Objekts ab.

SigningKey

Dient zum Abrufen oder Festlegen des asymmetrischen Algorithmusschlüssels, der zum Signieren eines SignedXml Objekts verwendet wird.

SigningKeyName

Ruft den Namen des installierten Schlüssels ab, der zum Signieren des Objekts verwendet werden soll, oder legt diesen SignedXml fest.

Methoden

Name Beschreibung
AddObject(DataObject)

Fügt der Liste der zu signierten Objekte ein DataObject Objekt hinzu.

AddReference(Reference)

Fügt dem Reference Objekt ein SignedXml Objekt hinzu, das eine Digestmethode, einen Digestwert und eine Transformation beschreibt, die zum Erstellen einer digitalen XML-Signatur verwendet werden soll.

CheckSignature()

Bestimmt, ob die Signature Eigenschaft mithilfe des öffentlichen Schlüssels in der Signatur überprüft wird.

CheckSignature(AsymmetricAlgorithm)

Bestimmt, ob die Signature Eigenschaft für den angegebenen Schlüssel überprüft wird.

CheckSignature(KeyedHashAlgorithm)

Bestimmt, ob die Signature Eigenschaft für den angegebenen Nachrichtenauthentifizierungscodealgorithmus (MAC) überprüft wird.

CheckSignature(X509Certificate2, Boolean)

Bestimmt, ob die Signature Eigenschaft für das angegebene X509Certificate2 Objekt überprüft und optional, ob das Zertifikat gültig ist.

CheckSignatureReturningKey(AsymmetricAlgorithm)

Bestimmt, ob die Signature Eigenschaft mithilfe des öffentlichen Schlüssels in der Signatur überprüft wird.

ComputeSignature()

Berechnet eine digitale XML-Signatur.

ComputeSignature(KeyedHashAlgorithm)

Berechnet eine digitale XML-Signatur mithilfe des angegebenen Mac-Algorithmus (Message Authentication Code).

Equals(Object)

Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht.

(Geerbt von Object)
GetHashCode()

Dient als Standardhashfunktion.

(Geerbt von Object)
GetIdElement(XmlDocument, String)

Gibt das XmlElement Objekt mit der angegebenen ID aus dem angegebenen XmlDocument Objekt zurück.

GetPublicKey()

Gibt den öffentlichen Schlüssel einer Signatur zurück.

GetType()

Ruft die Type der aktuellen Instanz ab.

(Geerbt von Object)
GetXml()

Gibt die XML-Darstellung eines SignedXml Objekts zurück.

LoadXml(XmlElement)

Lädt einen SignedXml Zustand aus einem XML-Element.

MemberwiseClone()

Erstellt eine flache Kopie der aktuellen Object.

(Geerbt von Object)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Gilt für:

Weitere Informationen