Search Results for

    Show / Hide Table of Contents

    Class ExternalSigner

    Signs PDF documents with a key held by an external signing service, such as Azure Key Vault or a cloud HSM, through an IExternalSignatureProvider. The private key never leaves the service.

    Use with the IronPdf signing methods that accept an IHsmSigner. Set TimeStampUrl to embed an RFC 3161 timestamp.

    The signing certificate and chain are read from the provider once, when the signer is created. Create a new signer after the certificate or key changes. Signing fails if the certificate is expired or not yet valid.

    The LibraryPath, UserPin and TokenLabel properties do not apply to this signer.

    Inheritance
    System.Object
    AHsmSigner
    ExternalSigner
    Implements
    IHsmSigner
    System.IDisposable
    Inherited Members
    AHsmSigner.Dispose()
    AHsmSigner.EncodeWithOptionalTimestamp(<11d4c772-3579-4f93-ac46-b452e4461737>CmsSignedData)
    AHsmSigner.BuildPlaceholderSignatureBytes(Byte[])
    AHsmSigner.RequestTimestampToken(Byte[], String)
    AHsmSigner.LibraryPath
    AHsmSigner.UserPin
    AHsmSigner.TokenLabel
    AHsmSigner.Certificate
    AHsmSigner.Filter
    AHsmSigner.SubFilter
    AHsmSigner.SignPlaceholderLength
    AHsmSigner.InternalName
    AHsmSigner.Initialized
    AHsmSigner.TimeStampUrl
    AHsmSigner.TimestampHashAlgorithm
    Namespace: IronSoftware.Pdfium.Signing
    Assembly: IronPdf.dll
    Syntax
    public class ExternalSigner : AHsmSigner, IHsmSigner

    Constructors

    ExternalSigner(IExternalSignatureProvider, SignatureHashAlgorithms, String)

    Creates a signer that delegates signing to provider.

    Declaration
    public ExternalSigner(IExternalSignatureProvider provider, SignatureHashAlgorithms hashAlgorithm, string internalName = null)
    Parameters
    Type Name Description
    IExternalSignatureProvider provider

    Supplies the signing certificate and signs hashes.

    SignatureHashAlgorithms hashAlgorithm

    The signature hash algorithm. SHA256, SHA384 and SHA512 are supported. Services that tie the hash to the key size, such as Azure Key Vault ES384 and ES512, need SHA384 for P-384 keys and SHA512 for P-521 keys.

    System.String internalName

    Optional signature field name. A unique name is generated when null.

    Exceptions
    Type Condition
    System.ArgumentNullException

    provider is null.

    System.ArgumentException

    The provider does not supply a signing certificate, or the certificate is expired or not yet valid.

    System.NotSupportedException

    The hash algorithm or the certificate key type is not supported.

    Methods

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

    Declaration
    public override 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
    Overrides
    AHsmSigner.AttachSignature(Byte[], Byte[], Int32, Int32)

    DoDispose()

    Declaration
    protected override void DoDispose()
    Overrides
    AHsmSigner.DoDispose()

    GetCertificate()

    Declaration
    public override X509Certificate2 GetCertificate()
    Returns
    Type Description
    System.Security.Cryptography.X509Certificates.X509Certificate2
    Overrides
    AHsmSigner.GetCertificate()

    GetDetachedSignature(Byte[])

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

    Initialize()

    Declaration
    protected override void Initialize()
    Overrides
    AHsmSigner.Initialize()

    Implements

    IHsmSigner
    System.IDisposable

    Inherited members

    Dispose()
    EncodeWithOptionalTimestamp(<11d4c772-3579-4f93-ac46-b452e4461737>CmsSignedData)
    BuildPlaceholderSignatureBytes(Byte[])
    RequestTimestampToken(Byte[], String)
    LibraryPath
    UserPin
    TokenLabel
    Certificate
    Filter
    SubFilter
    SignPlaceholderLength
    InternalName
    Initialized
    TimeStampUrl
    TimestampHashAlgorithm
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget