iText 9.0.0 API
iText.Signatures.PrivateKeySignature Class Reference

Implementation of the IExternalSignature interface that can be used when you have a iText.Commons.Bouncycastle.Crypto.IPrivateKey object. More...

Inheritance diagram for iText.Signatures.PrivateKeySignature:
iText.Signatures.IExternalSignature

Public Member Functions

  PrivateKeySignature (IPrivateKey pk, String hashAlgorithm)
  Creates a PrivateKeySignature instance. More...
 
  PrivateKeySignature (IPrivateKey pk, String hashAlgorithm, String signatureAlgorithm, IApplicableSignatureParams @params)
  Creates a PrivateKeySignature instance. More...
 
virtual String  GetDigestAlgorithmName ()
  Returns the digest algorithm. More...
 
virtual String  GetSignatureAlgorithmName ()
  Returns the signature algorithm used for signing, disregarding the digest function. More...
 
virtual ISignatureMechanismParams  GetSignatureMechanismParameters ()
  Return the algorithm parameters that need to be encoded together with the signature mechanism identifier. More...
 
virtual byte[]  Sign (byte[] message)
  Signs the given message using the encryption algorithm in combination with the hash algorithm. More...
 

Detailed Description

Implementation of the IExternalSignature interface that can be used when you have a iText.Commons.Bouncycastle.Crypto.IPrivateKey object.

Constructor & Destructor Documentation

◆ PrivateKeySignature() [1/2]

iText.Signatures.PrivateKeySignature.PrivateKeySignature ( IPrivateKey  pk,
String  hashAlgorithm 
)
inline

Creates a PrivateKeySignature instance.

Parameters
pk A iText.Commons.Bouncycastle.Crypto.IPrivateKey object.
hashAlgorithm A hash algorithm (e.g. "SHA-1", "SHA-256",...).
provider A security provider (e.g. "BC").

◆ PrivateKeySignature() [2/2]

iText.Signatures.PrivateKeySignature.PrivateKeySignature ( IPrivateKey  pk,
String  hashAlgorithm,
String  signatureAlgorithm,
IApplicableSignatureParams params 
)
inline

Creates a PrivateKeySignature instance.

Parameters
pk A iText.Commons.Bouncycastle.Crypto.IPrivateKey object.
hashAlgorithm A hash algorithm (e.g. "SHA-1", "SHA-256",...).
signatureAlgorithm A signiture algorithm (e.g. "RSASSA-PSS", "id-signedData", "sha256WithRSAEncryption", ...)
provider A security provider (e.g. "BC").
params Parameters for using RSASSA-PSS or other algorithms requiring them.

Member Function Documentation

◆ GetDigestAlgorithmName()

virtual String iText.Signatures.PrivateKeySignature.GetDigestAlgorithmName ( )
inlinevirtual

Returns the digest algorithm.

Implements iText.Signatures.IExternalSignature.

◆ GetSignatureAlgorithmName()

virtual String iText.Signatures.PrivateKeySignature.GetSignatureAlgorithmName ( )
inlinevirtual

Returns the signature algorithm used for signing, disregarding the digest function.

Implements iText.Signatures.IExternalSignature.

◆ GetSignatureMechanismParameters()

virtual ISignatureMechanismParams iText.Signatures.PrivateKeySignature.GetSignatureMechanismParameters ( )
inlinevirtual

Return the algorithm parameters that need to be encoded together with the signature mechanism identifier.

Implements iText.Signatures.IExternalSignature.

◆ Sign()

virtual byte [] iText.Signatures.PrivateKeySignature.Sign ( byte[]  message )
inlinevirtual

Signs the given message using the encryption algorithm in combination with the hash algorithm.

Implements iText.Signatures.IExternalSignature.