EldoS | Feel safer!

Software components for data protection, secure storage and transfer

document.RemoveSignature removing field

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#24740
Posted: 04/30/2013 04:16:55
by John Cockrell (Basic support level)
Joined: 07/16/2012
Posts: 5

Hi

I am trying to remove a signature in a c# unit test using
Code
    using (TElPDFDocument document = new TElPDFDocument())
    {
        try
        {
            document.Open(pdfStream);

            if (document != null)
            {
                if (document.Opened)
                {
                    int count = document.SignatureCount;
                    document.RemoveSignature(0);
                }
            }

            // save the document
            document.Close(true);
        }
        catch (Exception exception)
        {
            LogHelper.LogException("PdfLibrary", exception);
            throw;
        }
    }



This does remove the signature however also seems to remove the signature field so it can't be re-signed.
The other signature in the pdf now says it is invalid as the document has changed (i think due to the field deletion).

Is RemoveSignature the right way to do this? It looks like it should be from https://www.eldos.com/forum/read.php?FID=7&TID=1024&MID=5535&sphrase_id=431798#message5535

Kind Regards,
John Cockrell
#24741
Posted: 04/30/2013 04:20:06
by John Cockrell (Basic support level)
Joined: 07/16/2012
Posts: 5

image uploaded of "Highlight field" not highlighting where the sig used to be, and message on the right saying field removed and other sigs error message.


#24742
Posted: 04/30/2013 04:50:24
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us.

Quote
This does remove the signature however also seems to remove the signature field so it can't be re-signed.
The other signature in the pdf now says it is invalid as the document has changed (i think due to the field deletion).

Is RemoveSignature the right way to do this? It looks like it should be from https://www.eldos.com/forum/read.php?F...essage5535

Yes, RemoveSignature method removes a signature and a field.

Quote
image uploaded of "Highlight field" not highlighting where the sig used to be, and message on the right saying field removed and other sigs error message.

Does a document had more than one signature?
In this case by deleting a first signature you will invalidate other signatures.
Also, you may use GetSignedVersion method to get the part of the document that is certified by the current signature (for example, delete all signatures except a first one in one step).
#24745
Posted: 04/30/2013 07:12:10
by John Cockrell (Basic support level)
Joined: 07/16/2012
Posts: 5

Hi Dmytro

Thanks for the response. Yes the document has two signatures and I want to remove the one most recently applied to it can be signed again. Is GetSignedVersion the best/only way to achieve this (remove a signature without removing the field)?

Kind Regards,
John
#24755
Posted: 04/30/2013 10:37:38
by Dmytro Bogatskyy (EldoS Corp.)

Quote
Thanks for the response. Yes the document has two signatures and I want to remove the one most recently applied to it can be signed again. Is GetSignedVersion the best/only way to achieve this (remove a signature without removing the field)?

In this case, yes, it is a best way. With GetSignedVersion method you get the same document as document prior to signing.
RemoveSignature method only marks signature objects as deleted, but doesn't delete them physically, because the document still have signatures. And this method can't delete a signature without removing a signature field at the moment.
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 906 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!