Digital Signature Query - InfoPath Dev
in

InfoPath Dev

Digital Signature Query

Last post 07-15-2005 09:49 PM by Patrick Halstead. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 07-13-2005 02:38 PM

    • niraj
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 17

    Digital Signature Query

    Hi,

    I have a couple of queries about digital signature.

    First is it possible to have counter signatures for the whole form like we
    have for parts of the form. ( i mean signing the form + the existing
    signature)

    Secondly where is the data about who signed the form stored.
    I would like to extract the name or username of people who have signed a
    particular form and list them. In the signature information i could not find
    it.
    If you could tell me where in the signature group in which element it is
    stored that would be great.

    Thanks
    Niraj


  • 07-13-2005 02:46 PM In reply to

    Re: Digital Signature Query

    Hi Niraj and welcome to the board,

    We have a project that parallels yours. Using the Tools->Form Options->Digital Signatures wizard, you can't have both per-section and per-form digisigs, but you can select per-section digisigs and have some code that signs the entire form when a button is clicked and I believe this will work for counter-sign as well as co-sign.

    As for the extraction of user data ... good question. The Signature object (see the InfoPath SDK), contains Comment, Status, SignatureBlockXmlNode, and Certificate. You'll want to get the Certificate object and access the IssuedTo property of that.

    Good luck!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 07-13-2005 02:59 PM In reply to

    • niraj
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 17

    Re: Digital Signature Query

    Hi Patrick,
    So you mean i should write an XPath query and retrieve the data.

    If possible could you just give a simple example.

    Thanks
    Niraj
  • 07-13-2005 03:09 PM In reply to

    Re: Digital Signature Query

    Hi again Niraj,
    No, you can just write some managed code in the form to access the OM. XPath and OM don't work together. To access the OM, you'll have to write some code, but this isn't so hard. Do you have the Visual Studio plugin? If not, see our home page. There's a link in the left pane.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 07-14-2005 09:23 AM In reply to

    • niraj
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 17

    Re: Digital Signature Query

    Patrick,

    Sorry this may sound very silly but I am bit confused and would like to make things clear for me.

    The Signature Object can be accessed using Vbscript or JScript?
    Or is it that the Signature Object can be accessed using C#?

    I think you meant C# but still to make things clearer for me.

    And if possible could you please provide some code snippets.

    That will be great help.

    Thanks
    Niraj


  • 07-14-2005 10:42 AM In reply to

    Re: Digital Signature Query

    Hi Niraj,
    You can access the signature object from script (Jscript or VBscript) or managed code (C# or VB.NET). For the latter, you will have to install .NET Framework and reinstall InfoPath to recognize it. I have asked Agni to provide code snippets later today.
    Cheers!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 07-14-2005 12:23 PM In reply to

    Re: Digital Signature Query

    Hi Niraj,
    Place where you find username who has signed is
    thisXDocument.SignedDataBlocks[0].Signatures[0].Certificate.IssuedTo

    SignedDataBlocks and Signatures is a collection, you might want to use IEnumerator class for these two things instead of using indexing.

    Hope this helps!

    Agni
    InfoPathDev India
  • 07-14-2005 01:30 PM In reply to

    • niraj
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 17

    Re: Digital Signature Query

    Thanks a lot Agni,

    This is a managed code though, right?

    I was looking for VbScript and after a lot of trial and error and some research i found it out.
    It is very much identical to the managed code that you gave.

    This is I access it through VbScript

    XDocument.SignedDataBlocks.Item(0).Signatures.Item(0).Certificate.IssuedTo

    To obtain counts of SignedDataBlocks and Signatures you could use this.

    XDocument.SignedDataBlocks.Count
    XDocument.SignedDataBlocks.Item(0).Signatures.Count

    Thanks a lot, for the code snippet so I am on the right track now.
    Hope this helps others who need it too.

    Thanks
    Niraj
  • 07-14-2005 11:41 PM In reply to

    Re: Digital Signature Query

    Thanks for the Information Niraj.


    Agni
    InfoPathDev India
  • 07-15-2005 01:59 PM In reply to

    • niraj
    • Not Ranked
    • Joined on 07-13-2005
    • Posts 17

    Re: Digital Signature Query

    Hi Patrick,

    Patrick as you told me i could access the issuedto property from the signature object.

    But the problem is that, that is the property of the certificate.
    It is not the login name or subject name of the person who has signed the form.
    I understand issuedto will be the identity of the person who owns the certificate but to trust IssuedTo to be true we need to have full trust on the certificate.
    Doesnt infopath note in anyways the username or anyother credentials of the person who signed the form and not his certificate.

    Thanks

    Niraj



  • 07-15-2005 09:49 PM In reply to

    Re: Digital Signature Query

    Hi Niraj,

    I agree - what's the point of the certificate? :)

    The certificate and the logged in person should match if you have certificate authority running on the same domain that your users are logging in to.

    You can get the login username using System.Environment.Username. There is also a way to do this in JScript, but form has to be full trust. Your form needs to be domain trust to get te username using managed code.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.