次の方法で共有


XpsDigSigPartAlteringRestrictions 列挙型

定義

デジタル署名の範囲から除外される XPS Package の部分を指定します。

この列挙体は、メンバー値のビットごとの組み合わせをサポートしています。

public enum class XpsDigSigPartAlteringRestrictions
[System.Flags]
public enum XpsDigSigPartAlteringRestrictions
[<System.Flags>]
type XpsDigSigPartAlteringRestrictions = 
Public Enum XpsDigSigPartAlteringRestrictions
継承
XpsDigSigPartAlteringRestrictions
属性

フィールド

名前 説明
None 0

パーツは除外されません。

CoreMetadata 1

コア プロパティ パーツは除外されます。

Annotations 2

注釈パーツは除外されます。

SignatureOrigin 4

署名の配信元パーツは除外されます。

次の例は、この列挙を使用して 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

注釈

この列挙型には、メンバー値のビットごとの組み合わせを許可する FlagsAttribute があります。

デジタル署名から除外するように指定されたパーツは、署名を無効にせずに変更できます。 たとえば、ドキュメントに複数のユーザーが署名する場合、ドキュメントが最初に署名されるときに SignatureOrigin パーツを署名から除外する必要があります。 (除外は、SignDigitallyの呼び出しのrestrictions パラメーターで指定されます)。SignatureOrigin パーツが除外されていない場合、追加の署名は最初の署名者の署名を無効にします。

コア プロパティと署名元のパーツの詳細については、https://www.ecma-international.org/publications-and-standards/standards/ecma-376/でダウンロードできるオープン パッケージ規則仕様の第 3 章を参照してください。

適用対象

こちらもご覧ください