Method PrepareSignatureAsync
PrepareSignatureAsync(SignatureInfo, Byte[], HashAlgorithmName, Int32)
Prepares a new signature. This may add a new signature field to the document.
Declaration
public Task<bool> PrepareSignatureAsync(SignatureInfo signatureInfo, byte[] signatureImage, HashAlgorithmName hashAlgorithmName, int size)
Parameters
Type | Name | Description |
---|---|---|
SignatureInfo | signatureInfo | The signature info. |
System.Byte[] | signatureImage | The PNG encoded image to be depicted in the field. |
System.Security.Cryptography.HashAlgorithmName | hashAlgorithmName | The hash algorithm for the content digest calculation. |
System.Int32 | size | The size of the <Content> field of the signature field dictionary. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | The returned task results in in case of error.
|
Remarks
Give an estimate of the expected size of the <Content> entry of the signature field dictionary. If the estimate is too low, the signature will fail. In order to prevent that, make a conservative estimate, that is, give a number that is bigger than the actual size of the CMS-SignedData (PKCS-7 container).
If the structure contains one or two certificates 12KiB should suffice.
If the structure contains 100KiB of biodata, use 112KiB as an estimate.
PrepareSignatureAsync(SignatureInfo, Bitmap, HashAlgorithmName, Int32)
Prepares a new signature. This may add a new signature field to the document.
Declaration
public Task<bool> PrepareSignatureAsync(SignatureInfo signatureInfo, Bitmap signatureImage, HashAlgorithmName hashAlgorithmName, int size)
Parameters
Type | Name | Description |
---|---|---|
SignatureInfo | signatureInfo | The signature info. |
System.Drawing.Bitmap | signatureImage | The image to be depicted in the field. |
System.Security.Cryptography.HashAlgorithmName | hashAlgorithmName | The hash algorithm for the content digest calculation. |
System.Int32 | size | The size of the <Content> field of the signature field dictionary. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | The returned task results in in case of error.
|
Remarks
Give an estimate of the expected size of the <Content> entry of the signature field dictionary. If the estimate is too low, the signature will fail. In order to prevent that, make a conservative estimate, that is, give a number that is bigger than the actual size of the CMS-SignedData (PKCS-7 container).
If the structure contains one or two certificates 12KiB should suffice.
If the structure contains 100KiB of biodata, use 112KiB as an estimate.