XpsDigSigPartAlteringRestrictions 列舉

定義

指定從數位簽章範圍中排除之 XPS Package 的組件。

此列舉支援其成員值的位元組合。

C#
[System.Flags]
public enum XpsDigSigPartAlteringRestrictions
繼承
XpsDigSigPartAlteringRestrictions
屬性

欄位

名稱 Description
Annotations 2

附註的組件已經排除。

CoreMetadata 1

核心屬性的組件已經排除。

None 0

沒有被排除的組件。

SignatureOrigin 4

簽章原點的組件已經排除。

範例

下列範例示範如何使用這個列舉來數位簽署 XPS 檔。

C#

// ------------------------------ SignXps -----------------------------
/// <summary>
///   Signs an XPS document with a given X509 certificate, and if one
///   exists, associates the signature with a given SignatureDefintion
///   spotId GUID.</summary>
/// <param name="xpsDocument">
///   The XPS document to sign.</param>
/// <param name="cert">
///   The X509 certificate to use for signing.</param>
/// <param name="spotId">
///   The nullable spotId GUID of the signature definition.</param>
public void SignXps(
    XpsDocument xpsDocument, X509Certificate cert, Guid? spotId )
{
    // If there's a SignatureDefinition spotId,
    // associate it with the signature.
    if (spotId != null)
    {
        xpsDocument.SignDigitally(
            cert, true, XpsDigSigPartAlteringRestrictions.None,
            spotId.Value);
    }
    else
    {
        xpsDocument.SignDigitally(
            cert, true, XpsDigSigPartAlteringRestrictions.None);
    }
}// end:SignXps()

備註

此列舉具有 FlagsAttribute,可允許其成員值的位元組合。

指定為已從數位簽章中排除的部分可以修改,而不會使簽章失效。 例如,如果檔是由多個人員簽署,則第一次簽署檔時,SignatureOrigin 元件必須從簽章中排除。 (排除專案是在呼叫 SignDigitally .) 的 參數中 restrictions 指定。如果未排除 SignatureOrigin 元件,則任何其他簽章會使第一個簽署者的簽章失效。

如需數位簽章的詳細資訊,請參閱 開放式封裝慣例的數位簽章架構

如需核心屬性和簽章原始元件的詳細資訊,請參閱 可供 https://www.ecma-international.org/publications-and-standards/standards/ecma-376/ 下載的開放式封裝慣例規格第 3 章。

適用於

產品 版本
.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

另請參閱