Get Signer information of S/MIME Message

Hi

I have a client that needs to print an information that a message was signed with an Internet Certificate.

So i create a field that is populated with the signer information.

To get this information, i wrote an Agent that was triggered with "After new mail arrives. Bellow is the code.

My problem is that doc.IsSigned is true, but the Signer is empty. Anyone can help

Sub Initialize

    On Error Goto ErrHandler

    Dim session As New NotesSession

    Dim db As NotesDatabase

    Dim collection As NotesDocumentCollection

    Dim doc As NotesDocument

    Dim sSigner As String

   

    Set db = session.CurrentDatabase

    Set collection = db.UnprocessedDocuments

    Set doc = collection.GetFirstDocument()

    While Not(doc Is Nothing)

            If doc.IsSigned Then

                    sSigner = doc.Signer

                    If sSigner <> "" Then

                            sSigner = "Signed Byr: " & doc.Signer

                    End If

                    doc.X_ISSIGNED = "1"                        

                    doc.X_SIGNEDMESSAGE = sSigner

                    Call doc.Save( True, False )                        

            End If

            Set doc = collection.GetNextDocument(doc)

    Wend

    Exit Sub

ErrHandler:

    Print "agChecksignedMessage: " & Error$ & " on line " & Cstr(Erl)

    Resume Next

End Sub

Subject: The problem is that you lost the signature

Hello,I think the problem is, when you save the document, you just altered. So, you lost any signer information.

You gotta identified somehow that your document is signed in a view column and show a icon. If you try to change any item in the document, you loose the signature.