NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

NerdyHearn - Blog


<< Back To All Blogs

Reading Digital Signatures from InfoPath Forms in MOSS 2007 and WSS 3.0 Workflow

Monday, June 1st, 2009

InfoPath forms with SharePoint workflow is a very powerful combination, especially when you use Digital Signatures to verify the user that is completing the form. Most workflow forms will go through more then one person, and therefore you need to be able to check when the actual form is signed by specific entities in order to continue with your workflow.

I have created a LINQ method of reading these InfoPath files for signature information during a workflow. Please note that this also requires that you have .NET 3.5 enabled on your SharePoint server.

Without further ado, here it is:

List signatures = new List();

SPListItem item = workflowProperties.Item;
using (MemoryStream ms = new MemoryStream(item.File.OpenBinary()))
{
System.Xml.XmlReader reader = System.Xml.XmlReader.Create(ms);
XDocument xDoc = XDocument.Load(reader);

XNamespace nsSig = "http://www.w3.org/2000/09/xmldsig#";
XNamespace nsSigProp = "http://schemas.microsoft.com/office/infopath/2003/SignatureProperties";
var sigs = from sig in xDoc.Descendants(nsSig + "Signature")
select new
Signature
{
ID = sig.Attribute("Id").Value.ToString(),
Text = sig.Descendants(nsSigProp + "SignatureText").First().Value,
Value = sig.Descendants(nsSig + "SignatureValue").First().Value,
X509Certificate = sig.Descendants(nsSig + "X509Certificate").First().Value
};

signatures = sigs.ToList();
reader.Close();
}

There are a number of further attributes that you could grab from this information, but that should get you started off right.

InfoPathin' Tom Out.

Tags

SharePoint CSharp InfoPath

Related Blogs

Using MOSS and WSS SharePoint Workflow to Resize Images in an Image Library

Automatically Setting File Name in SharePoint when submitting an InfoPath 2007 Form
Receiving null value when using SPFarm.Local on SharePoint 2010
Adding jQuery to SharePoint

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations