Click or drag to resize

SKMIsKeyInformationGenuine Method

This method allows you to check if the key information (creation date, expiration date, etc.) in a request was modified on the way from Serial Key Manager server to the client application.

Namespace:  SKGL
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static bool IsKeyInformationGenuine(
	KeyInformation keyInformation,
	string rsaPublicKey
)

Parameters

keyInformation
Type: SKGLKeyInformation
The variable that contains the key information (including the signature)
rsaPublicKey
Type: SystemString
The public key (RSA)

Return Value

Type: Boolean
True, if no changes were detected. False, otherwise.
Examples
The code below demonstrates how IsKeyInformationGenueine can be used in offine key validation. Please read more about offline key validation at http://support.serialkeymanager.com/kb/passive-key-validation/.
C#
public static void OfflineKeyValidationWithPeriodicTimeCheck()
{
   var RSAPublicKey = "RSA public key";

   var keyInfo = new KeyInformation().LoadFromFile("license2.txt");

   if (keyInfo.HasValidSignature(RSAPublicKey, 30)
              .IsOnRightMachine()
              .IsValid())
   {
       // the signature is correct so
       // the program can now launch
   }
   else
   {
       var machineCode = SKGL.SKM.getMachineCode(SKGL.SKM.getSHA1);
       keyInfo = SKGL.SKM.KeyActivation("3", "2", "751963", "MJAWL-ITPVZ-LKGAN-DLJDN", machineCode, secure: true, signMid: true, signDate: true);

       if (keyInfo.HasValidSignature(RSAPublicKey)
                  .IsOnRightMachine()
                  .IsValid())
       {
           // the signature is correct and the key is valid.
           // save to file.
           keyInfo.SaveToFile("license2.txt");

           // the program can now launch
       }
       else
       {
           // failure. close the program.
       }
   }
}
See Also