What is the best way for an InstallAware installer to verify a license key-- which is in the form of a signed xml document?
The scenario is as follows:
1.) User runs the installer which goes to a "license entry" page
2.) User pastes a license key (in the form of a signed xml document) into a field
3.) Installer verifys the license by
a.) xsd validating the xml
b.) signature validating the xml
********************
Following is the VB.NET code we use in the code to signature validate the XML:
' Verify the signature of an XML file against an asymetric algorithm and return the result.
Private Shared Function VerifyXmlDocument(ByVal xmlDocument1 As System.Xml.XmlDocument, _
ByVal key As System.Security.Cryptography.AsymmetricAlgorithm) As Boolean
' Create a new SignedXml object and pass it the XML document class.
Dim signedXml As New System.Security.Cryptography.Xml.SignedXml(xmlDocument1)
' Find the "Signature" node and create a new XmlNodeList object.
Dim nodeList As System.Xml.XmlNodeList = xmlDocument1.GetElementsByTagName(SignatureElement)
' Load the signature node.
signedXml.LoadXml(CType(nodeList(0), System.Xml.XmlElement))
' Check the signature and return the result.
Return signedXml.CheckSignature(key)
End Function
Using InstallAware to Verify a Signed XML License
-
- Posts: 29
- Joined: Tue Oct 16, 2007 10:30 am
-
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
You can create a DLL from your VB.NET code. After that you can call the functions in your DLL from inside IA with the Call DLL Function plug-in. That shoud do it
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 29
- Joined: Tue Oct 16, 2007 10:30 am
Hi Alex,
Thanks for the reply.
My current understanding is that I can only call a Win32 DLL from Installaware. Could you explain how I can call a .NET dll?
(per a prior email from Candace at InstallAware)
You cannot call COM objects from InstallAware. You can call Win32 DLLs (or other DLLs using the stdcall calling convention).
Thanks for the clarification!
Thanks for the reply.
My current understanding is that I can only call a Win32 DLL from Installaware. Could you explain how I can call a .NET dll?
(per a prior email from Candace at InstallAware)
You cannot call COM objects from InstallAware. You can call Win32 DLLs (or other DLLs using the stdcall calling convention).
Thanks for the clarification!
-
- Posts: 29
- Joined: Tue Oct 16, 2007 10:30 am
Hi Alex,
Thanks for the reply.
My current understanding is that I can only call a Win32 DLL from Installaware. Could you explain how I can call a .NET dll?
(per a prior email from Candace at InstallAware)
You cannot call COM objects from InstallAware. You can call Win32 DLLs (or other DLLs using the stdcall calling convention).
Thanks for the clarification!
Thanks for the reply.
My current understanding is that I can only call a Win32 DLL from Installaware. Could you explain how I can call a .NET dll?
(per a prior email from Candace at InstallAware)
You cannot call COM objects from InstallAware. You can call Win32 DLLs (or other DLLs using the stdcall calling convention).
Thanks for the clarification!
Alex made a mistake. You cannot call non-native (Win32) dlls from InstallAware. The best to thing to do is create a small .exe file and run it with "Run Program" to validate the xml file and catch it's exit code (for example 2 for success, -1 for failure).
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation
-
- Posts: 29
- Joined: Tue Oct 16, 2007 10:30 am
-
- Site Admin
- Posts: 364
- Joined: Mon Jul 30, 2007 11:51 am
- Location: USA
- Contact:
Sorry, that is right. I misunderstood it for a moment. Gizmo is right. Sorry for the wrong advice
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 107 guests