Hello. I'm trying to get Digital Signature data (Status, Certificate, Comment) into text fields.
Im trying to do this by using the Singature class
http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.signature.aspx.
The code works on client (preview) but not in the browser. (Log files exception message: The method or operation is not implemented.)
A strange thing is that I had to change the path of reference Microsoft.Office.InfoPath.dll to C:\Program Files\Microsoft Office Servers\12.0\Bin\Microsoft.Office.InfoPath.dll
(There are several dll files with the same name on the server but only this one includes the Signature Class)
I guess the form is not using the correct dll file when published.
Any ideas on how make this work or an alternative on how to retrieve the data?
My VB code is the following:
Imports
Microsoft.Office.InfoPath
Imports System
Imports System.Xml
Imports System.Xml.XPath
Imports System.Object
Imports Microsoft.VisualBasic.Constants
Imports Microsoft.Office.InfoPath.Signature
Namespace RetreiveDigitalSignature3Public Class FormCode
Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup
AddHandler DirectCast(EventManager.ControlEvents("CTRL5_5"), ButtonEvent).Clicked, AddressOf CTRL5_5_ClickedEnd Sub
Public Sub CTRL5_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
' Get signature.
Dim mySignature As Signature = Me.SignedDataBlocks(0).Signatures(0)
' Get status of signature.
Dim sigStatus As String = mySignature.Status.ToString()
' Get comment.
Dim signatureComment As String = mySignature.Comment
' Get certificate used to sign with.
Dim signatureCertificate As Certificate = mySignature.Certificate
Dim mainNav As XPathNavigator = MainDataSource.CreateNavigator()
mainNav.SelectSingleNode("/my:myFields/my:field1", Me.NamespaceManager()).SetValue(sigStatus)
mainNav.SelectSingleNode("/my:myFields/my:field2", Me.NamespaceManager()).SetValue(signatureComment)
mainNav.SelectSingleNode("/my:myFields/my:field3", Me.NamespaceManager()).SetValue(signatureCertificate.IssuedTo)
End Sub
End Class
End Namespace