Search Results for

    Show / Hide Table of Contents

    Class AHsmSigner

    Inheritance
    System.Object
    AHsmSigner
    UsbPkcs11HsmSigner
    Implements
    IHsmSigner
    System.IDisposable
    Namespace: IronSoftware.Pdfium.Signing
    Assembly: IronPdf.dll
    Syntax
    public abstract class AHsmSigner : Object, IHsmSigner, IDisposable

    Constructors

    AHsmSigner(String, String, String, String)

    Declaration
    protected AHsmSigner(string libraryPath, string userPin, string tokenLabel, string internalName = null)
    Parameters
    Type Name Description
    System.String libraryPath
    System.String userPin
    System.String tokenLabel
    System.String internalName

    Properties

    Certificate

    Declaration
    public  < 11d  4  c772 - 3579 - 4f  93 - ac46 - b452e4461737 > X509Certificate Certificate { get; protected set; }
    Property Value
    Type Description
    <11d4c772-3579-4f93-ac46-b452e4461737>X509Certificate

    Filter

    Declaration
    public string Filter { get; protected set; }
    Property Value
    Type Description
    System.String

    Initialized

    Declaration
    public bool Initialized { get; protected set; }
    Property Value
    Type Description
    System.Boolean

    InternalName

    Declaration
    public string InternalName { get; set; }
    Property Value
    Type Description
    System.String

    LibraryPath

    Declaration
    public string LibraryPath { get; set; }
    Property Value
    Type Description
    System.String

    SignPlaceholderLength

    Declaration
    public int SignPlaceholderLength { get; protected set; }
    Property Value
    Type Description
    System.Int32

    SubFilter

    Declaration
    public string SubFilter { get; protected set; }
    Property Value
    Type Description
    System.String

    TimestampHashAlgorithm

    Hash algorithm the TSA is asked to use when time-stamping the signature. Ignored when TimeStampUrl is not set. Defaults to SHA256. SHA-1 imprints are deprecated for RFC 3161 and rejected by many production TSAs, so SHA-256 is the default here even though the certificate-based path historically defaults to SHA-1.

    Declaration
    public TimestampHashAlgorithms TimestampHashAlgorithm { get; set; }
    Property Value
    Type Description
    TimestampHashAlgorithms

    TimeStampUrl

    Optional RFC 3161 Time Stamp Authority (TSA) URL. When set, the signature produced by GetDetachedSignature(Byte[]) embeds a trusted timestamp token as an unsigned id-aa-signatureTimeStampToken attribute. When null or empty, no timestamp is added and signing behaviour is unchanged. Named to match PdfSignature.TimeStampUrl on the certificate-based signing path.

    Declaration
    public string TimeStampUrl { get; set; }
    Property Value
    Type Description
    System.String

    TokenLabel

    Declaration
    public string TokenLabel { get; set; }
    Property Value
    Type Description
    System.String

    UserPin

    Declaration
    public string UserPin { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    AttachSignature(Byte[], Byte[], Int32, Int32)

    Declaration
    public abstract bool AttachSignature(byte[] pdfBytes, byte[] dataToSign, int signEndInBytes, int signStartInBytes)
    Parameters
    Type Name Description
    System.Byte[] pdfBytes
    System.Byte[] dataToSign
    System.Int32 signEndInBytes
    System.Int32 signStartInBytes
    Returns
    Type Description
    System.Boolean

    BuildPlaceholderSignatureBytes(Byte[])

    Wraps a DER-encoded detached signature into the fixed-size, hex-encoded /Contents placeholder that the reserved signature byte range expects. Validates that the signature (which includes the timestamp token when TimeStampUrl is set) actually fits within SignPlaceholderLength, throwing a descriptive TimestampException rather than letting a raw buffer copy fail if it does not.

    Declaration
    protected byte[] BuildPlaceholderSignatureBytes(byte[] detachedSignature)
    Parameters
    Type Name Description
    System.Byte[] detachedSignature

    The DER-encoded detached CMS to wrap.

    Returns
    Type Description
    System.Byte[]

    The ASCII bytes of the hex-encoded, angle-bracketed placeholder contents.

    Exceptions
    Type Condition
    TimestampException

    Thrown when the signature does not fit the reserved placeholder.

    Dispose()

    Declaration
    public void Dispose()

    DoDispose()

    Declaration
    protected abstract void DoDispose()

    EncodeWithOptionalTimestamp(<11d4c772-3579-4f93-ac46-b452e4461737>CmsSignedData)

    Declaration
    protected byte[] EncodeWithOptionalTimestamp( < 11d  4  c772 - 3579 - 4f  93 - ac46 - b452e4461737 > CmsSignedData signedData)
    Parameters
    Type Name Description
    Org.BouncyCastle.Cms.<11d4c772-3579-4f93-ac46-b452e4461737>CmsSignedData signedData
    Returns
    Type Description
    System.Byte[]

    GetCertificate()

    Declaration
    public abstract X509Certificate2 GetCertificate()
    Returns
    Type Description
    System.Security.Cryptography.X509Certificates.X509Certificate2

    GetDetachedSignature(Byte[])

    Declaration
    public abstract byte[] GetDetachedSignature(byte[] dataToSign)
    Parameters
    Type Name Description
    System.Byte[] dataToSign
    Returns
    Type Description
    System.Byte[]

    Initialize()

    Declaration
    protected abstract void Initialize()

    RequestTimestampToken(Byte[], String)

    Contacts the Time Stamp Authority at TimeStampUrl and returns the DER-encoded RFC 3161 timestamp token for the supplied imprint. Overridable so that tests can supply a deterministic token without a network round-trip.

    Declaration
    protected virtual byte[] RequestTimestampToken(byte[] imprint, string digestOid)
    Parameters
    Type Name Description
    System.Byte[] imprint

    The message imprint (hash of the signature value) to be time-stamped.

    System.String digestOid

    OID of the digest algorithm the imprint was computed with.

    Returns
    Type Description
    System.Byte[]

    The DER-encoded timestamp token.

    Implements

    IHsmSigner
    System.IDisposable
    ☀
    ☾
    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