XpsDigSigPartAlteringRestrictions Výčet

Definice

Určuje části XPS Package , které jsou vyloučeny z rozsahu digitálního podpisu.

Tento výčet podporuje bitové kombinace hodnot jeho členů.

public enum class XpsDigSigPartAlteringRestrictions
[System.Flags]
public enum XpsDigSigPartAlteringRestrictions
[<System.Flags>]
type XpsDigSigPartAlteringRestrictions = 
Public Enum XpsDigSigPartAlteringRestrictions
Dědičnost
XpsDigSigPartAlteringRestrictions
Atributy

Pole

Annotations 2

Část Poznámky je vyloučena.

CoreMetadata 1

Část Základní vlastnosti je vyloučena.

None 0

Nejsou vyloučeny žádné části.

SignatureOrigin 4

Část Původ podpisu je vyloučena.

Příklady

Následující příklad ukazuje, jak pomocí tohoto výčtu digitálně podepsat dokument XPS.


// ------------------------------ 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()

' ------------------------------ 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 Sub SignXps(xpsDocument As XpsDocument, cert As X509Certificate, spotId? As Guid)
    ' If there's a SignatureDefinition spotId,
    ' associate it with the signature.
    If spotId IsNot Nothing Then
        xpsDocument.SignDigitally(cert, True, XpsDigSigPartAlteringRestrictions.None, spotId.Value)
    Else
        xpsDocument.SignDigitally(cert, True, XpsDigSigPartAlteringRestrictions.None)
    End If

End Sub

Poznámky

Tento výčet obsahuje FlagsAttribute, který umožňuje bitovou kombinaci jejích hodnot členů.

Části, které jsou určené jako vyloučené z digitálního podpisu, lze upravit bez zrušení platnosti podpisu. Pokud má být například dokument podepsán více než jednou osobou, musí být část SignatureOrigin vyloučena z podpisu při prvním podepsání dokumentu. (Vyloučení jsou zadána v restrictions parametru volání . SignDigitally) Pokud není část SignatureOrigin vyloučena, všechny další podpisy zneplatní podpis prvního podepisujícího.

Další informace o digitálníchpodpisch

Další informace o základních vlastnostech a částech původu podpisu naleznete v kapitole 3 specifikace Open Packaging Conventions k dispozici ke stažení na https://www.ecma-international.org/publications-and-standards/standards/ecma-376/adrese .

Platí pro

Viz také