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, Also PKCS11 converted to 12.

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

    Constructors

    PdfSignature(Byte[], String, String)

    Initializes a new instance of the PdfSignature class.

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

    The certificate as a binary data (byte array).

    System.String Password

    The certificate's password.

    System.String TimeStampUrl

    Url used for time-stamping the signature.

    PdfSignature(X509Certificate2)

    Initializes a new instance of the PdfSignature class. Not working in docker mode (Installation.UseIronPdfEngineDocker)

    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, String)

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

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

    The file path to certificate.

    System.String Password

    The certificate's password.

    System.String TimeStampUrl

    Url used for time-stamping the signature.

    Fields

    ContactInformation

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

    Declaration
    public string ContactInformation
    Field Value
    Type Description
    System.String

    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, Int32, Rectangle)LoadSignatureImageFromStream(Stream, Int32, Rectangle)

    Declaration
    public PdfSignatureImage SignatureImage
    Field Value
    Type Description
    PdfSignatureImage

    SigningContact

    The contact person (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

    TimestampHashAlgorithm

    Algorithm requested to be used by the time-stamping server

    Declaration
    public TimestampHashAlgorithms TimestampHashAlgorithm
    Field Value
    Type Description
    TimestampHashAlgorithms

    TimeStampUrl

    Url to be used when time-stamping the signature

    Declaration
    public string TimeStampUrl
    Field Value
    Type Description
    System.String

    Methods

    FromBase64(String, String, String)

    Create a new PDF signature from the specified base64 string

    Declaration
    public static PdfSignature FromBase64(string Base64, string Password = null, string TimeStampUrl = null)
    Parameters
    Type Name Description
    System.String Base64

    Base-64 string which represents a certificate

    System.String Password

    Certificate password

    System.String TimeStampUrl

    Optional Time-stamping URL

    Returns
    Type Description
    PdfSignature

    PDF signature

    LoadSignatureImageFromFile(String, Int32, Rectangle)

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

    Declaration
    public void LoadSignatureImageFromFile(string FilePath, int PageIndex, Rectangle Rectangle)
    Parameters
    Type Name Description
    System.String FilePath

    Image path

    System.Int32 PageIndex

    Page index to display image

    IronSoftware.Drawing.Rectangle Rectangle

    Rectangle to display image

    LoadSignatureImageFromStream(Stream, Int32, Rectangle)

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

    Declaration
    public void LoadSignatureImageFromStream(Stream Stream, int PageIndex, Rectangle Rectangle)
    Parameters
    Type Name Description
    System.IO.Stream Stream

    The image file as a stream.

    System.Int32 PageIndex

    Page index to display image

    IronSoftware.Drawing.Rectangle Rectangle

    Rectangle to display image

    Extension Methods

    PdfSignatureExtensions.SignPdfFile(PdfSignature, String, Boolean, String, String)
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronPDF_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronPDF