Search Results for

    Show / Hide Table of Contents

    Class PdfSignature

    A class that represents a PDF signing certificate (.PFX or .p12) format which can be used to digitally sign a PDF. This protecting it from alteration.

    Inheritance
    System.Object
    PdfSignature
    Namespace: IronPdf.Signing
    Assembly: IronPdf.dll
    Syntax
    public class PdfSignature : Object

    Constructors

    PdfSignature(Byte[], String)

    Initializes a new instance of the PdfSignature class.

    Declaration
    public PdfSignature(byte[] CertificateRawData, string Password)
    Parameters
    Type Name Description
    System.Byte[] CertificateRawData

    The certificate as a binary data (byte array).

    System.String Password

    The certificate's password.

    PdfSignature(X509Certificate2)

    Initializes a new instance of the PdfSignature class.

    Declaration
    public PdfSignature(X509Certificate2 ExportableNativeCertificate)
    Parameters
    Type Name Description
    System.Security.Cryptography.X509Certificates.X509Certificate2 ExportableNativeCertificate

    The exportable native certificate as a System.Security.Cryptography.X509Certificates.X509Certificate2.

    PdfSignature(String, String)

    Initializes a new instance of the PdfSignature class using a .pfx or .p12 digital signature file.

    Declaration
    public PdfSignature(string FilePathToCertificate, string Password)
    Parameters
    Type Name Description
    System.String FilePathToCertificate

    The file path to certificate.

    System.String Password

    The certificate's password.

    Fields

    SignatureDate

    The date and time of the digital signature. If left null, the signature will be timestamped at the millisecond that the PdfDocument is saved to Disk or Stream.

    Declaration
    public Nullable<DateTime> SignatureDate
    Field Value
    Type Description
    System.Nullable<System.DateTime>

    SignatureImage

    A visual image for the sign, often a PNG of a human signature or company stamp (optional).

    This appends a visual signature in addition to cryptographic signing.

    LoadSignatureImageFromFile(String)LoadSignatureImageFromStream(Stream)

    Declaration
    public Image SignatureImage
    Field Value
    Type Description
    System.Drawing.Image

    SigningContact

    The contact person or email address for signing related inquiries (optional).

    Declaration
    public string SigningContact
    Field Value
    Type Description
    System.String

    SigningLocation

    The physical location the PDF was signed (optional).

    Declaration
    public string SigningLocation
    Field Value
    Type Description
    System.String

    SigningReason

    The reason the PDF was signed (optional).

    Declaration
    public string SigningReason
    Field Value
    Type Description
    System.String

    Methods

    LoadSignatureImageFromFile(String)

    Loads a signature image from an image file. This appends a visual signature in addition to cryptographic signing.

    Declaration
    public void LoadSignatureImageFromFile(string FilePath)
    Parameters
    Type Name Description
    System.String FilePath

    The file path.

    LoadSignatureImageFromStream(Stream)

    Loads a signature image from a stream. This appends visual signature in addition to cryptographic signing.

    Declaration
    public void LoadSignatureImageFromStream(Stream Stream)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    The image file as a stream.

    SignPdfFile(String, Boolean, String, String)

    Signs an existing PDF file.

    Declaration
    public bool SignPdfFile(string PdfFilePath, bool RemoveOldSignatures = false, string UserPassword = null, string OwnerPassword = null)
    Parameters
    Type Name Description
    System.String PdfFilePath

    The PDF file path.

    System.Boolean RemoveOldSignatures

    if set to true old digital signatures are removed to ensure signing validity.

    System.String UserPassword

    Optional user password if the PDF document is encrypted.

    System.String OwnerPassword

    Optional owner password if the PDF document is encrypted.

    Returns
    Type Description
    System.Boolean

    true if successful.

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.