XpsSignatureDefinition Class

Definition

Represents an XpsDocument digital signature.

C#
public class XpsSignatureDefinition
Inheritance
XpsSignatureDefinition

Examples

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

C#

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

Remarks

For more information about signature definitions in XPS packages, see Chapter 10 in the XML Paper Specification (XPS).

For information about Package digital signatures, see Digital Signing Framework of the Open Packaging Conventions.

For information about XPS, see the XML Paper Specification (XPS).

Constructors

XpsSignatureDefinition()

Initializes a new instance of the XpsSignatureDefinition class.

Properties

Culture

Gets or sets the CultureInfo of the signature.

HasBeenModified

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.

Intent

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

RequestedSigner

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

SignBy

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

SigningLocale

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

SpotId

Gets or sets a unique identifier for this XpsSignatureDefinition.

SpotLocation

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

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also