Export (0) Print
Expand All

XpsSignatureDefinition Class

Represents an XpsDocument digital signature.

Namespace: System.Windows.Xps.Packaging
Assembly: ReachFramework (in reachframework.dll)

public class XpsSignatureDefinition
public class XpsSignatureDefinition
public class XpsSignatureDefinition
<XpsSignatureDefinition .../>

For more information about signature definitions in XPS packages, see Chapter 10 in the XML Paper Specification (XPS) available for download at http://go.microsoft.com/fwlink/?LinkID=65761.

For information about Package digital signatures, see the MSDN article Digital Signing Framework of the Open Packaging Conventions available at http://go.microsoft.com/fwlink/?LinkId=74494.

For information about XPS see the XML Paper Specification (XPS) available for download at http://go.microsoft.com/fwlink/?LinkID=65761.

The following example shows how to create and set the properties of an XpsSignatureDefinition.


private void SignatureDefinitionCommandHandler(object sender, RoutedEventArgs e)
{
    SignatureDefinition sigDefDialog = new SignatureDefinition();
    if (sigDefDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
        XpsSignatureDefinition signatureDefinition = new XpsSignatureDefinition();
        signatureDefinition.RequestedSigner = sigDefDialog.RequestedSigner.Text;
        signatureDefinition.Intent = sigDefDialog.Intent.Text;
        signatureDefinition.SigningLocale = sigDefDialog.SigningLocale.Text;
        try
        {
            signatureDefinition.SignBy = DateTime.Parse(sigDefDialog.SignBy.Text);
        }
        catch (FormatException)
        {
        }
        signatureDefinition.SpotId = Guid.NewGuid();
        IXpsFixedDocumentSequenceReader docSeq = _xpsDocument.FixedDocumentSequenceReader; //_xpsDocument is type System.Windows.Xps.Packaging.XpsDocument
        IXpsFixedDocumentReader doc = docSeq.FixedDocuments[0];
        doc.AddSignatureDefinition(signatureDefinition);
        doc.CommitSignatureDefinition();
        InitializeSignatureDisplay();
    }
}


For the complete sample, see Read-Write-Sign an XPS Document Sample.

System.Object
  System.Windows.Xps.Packaging.XpsSignatureDefinition

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft