XpsSignatureDefinition Class

XpsSignatureDefinition Class

 

Represents an XpsDocument digital signature.

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

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

public class XpsSignatureDefinition

NameDescription
System_CAPS_pubmethodXpsSignatureDefinition()

Initializes a new instance of the XpsSignatureDefinition class.

NameDescription
System_CAPS_pubpropertyCulture

Gets or sets the CultureInfo of the signature.

System_CAPS_pubpropertyHasBeenModified

Gets or sets a value that indicates whether unwritten property changes exist for the XpsSignatureDefinition class and must be written to the package's stream.

System_CAPS_pubpropertyIntent

Gets or sets the string value of the signature intention agreement that the signer is signing against.

System_CAPS_pubpropertyRequestedSigner

Gets or sets the identity of the person who is requested to sign (or has signed) the package.

System_CAPS_pubpropertySignBy

Gets or sets the date and time by which the requested signer must sign the parts of the specified document.

System_CAPS_pubpropertySigningLocale

Gets or sets the legal jurisdiction where the package is signed.

System_CAPS_pubpropertySpotId

Gets or sets a unique identifier for this XpsSignatureDefinition.

System_CAPS_pubpropertySpotLocation

Gets or sets the location that specifies where to display the visible digital signature in an XML Paper Specification (XPS) document.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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();
    }
}

.NET Framework
Available since 3.0

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

Return to top
Show:
© 2016 Microsoft