NX签名//NXOpen VB.Net / C# Sign

An executable for any application must be "signed" before it can be executed by anyone who does not have an NX Open Author license.  This section describes the signing process. This process is typically performed when an application is distributed to the user base and is used to verify that application have been developed using a valid NX Open Author license.

The following two steps define the general signing process.

  1. A resource file must be added to the source files. The resource must be compiled and linked with the executable. This step is not required for Java applications.

  2. Run the signing utility to add an encrypted string to the executable.

When running without an NX Open Author licenses NX will check for this encrypted string when the application is loaded.  If NX does not find an NX Open Author license or signature it will not load the executable, or in Batch mode the Common API will fail to initialize.

  • The signing utility may only be executed if an NX Open Author license if available.

  • The signing utility also provides a verify option that will display a message confirming whether the file has been correctly signed or not.

  • Running the signing utility multiple times on the same executable does no harm, the results are the same as running it once.

  • Journals and GRIP programs do not need to be signed.  All other NX Open applications must be signed.

 

VB.NET Example:

    1.Add NXOpen.dll / NXOpen.Utilities.dll /NXSigningResource.res three files to Project Resource

      1.1 Right click Project property and Enter Project Property Page 

      1.2 Select "Resource"

      1.3 Add Exist File --> Select "NXSignResource.res" /"NXOpen.Utilities.dll" / "NXOpen.dll "  to Project

    2.Build your project

    3.Start you command line and enter you <UGII_Install_Directory>\UGII

    4.To sign an executable run SignDotNet at a command line prompt and provide the name of the executable such as " SignDotNet your application"

      if it is success , you can find below message ; 

          Checking for the presence of DotNet Author License Signed assembly file your application

    5. Verify. if you want to verify signature whether or not success.Add "-Verify " in commad line.Result message as below.

          Assembly your application is correctly signed with a NXOpen signature.

 

  

 

posted @ 2014-09-11 22:50  Zekai  阅读(2168)  评论(0编辑  收藏  举报