<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class SecureLicense _ Inherits License _ Implements ISerializable, IChange
[SerializableAttribute] [ComVisibleAttribute(true)] public sealed class SecureLicense : License, ISerializable, IChange
See the SecureLicenseManager object for more information on how licenses are found, validated and issued.
To ensure that the license files have not been altered since they were issued, each SecureLicense is signed with a LicenseKey. The signing code uses an asymmetric public code encryption system with the public key embedded in the protected assembly that the class is implemented in. The private key remains secured with the original developers ensuring that only they can grant valid licenses, serial numbers, activations and extensions.
This sample demonstrates the basic use of a SecureLicense object after it has been validated.
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports DeployLX.Licensing.v5
Namespace VBProtectedDll
Public Class ProtectedClass
Private _license As SecureLicense
Public Sub New()
_license = SecureLicenseManager.Validate(Me, Nothing, Nothing)
End Sub
Public Sub DoSomething()
If _license.IsTrial Then
MessageBox.Show("Hello from ProtectedClass, enjoy the trial.")
Else
MessageBox.Show("Hello from ProtectedClass, thanks for your purchase.")
End If
End Sub
End Class
End Namespace
using System;
using System.Windows.Forms;
using DeployLX.Licensing.v5;
namespace CSharpProtectedDll
{
public class ProtectedClass
{
private SecureLicense _license;
public ProtectedClass()
{
_license = SecureLicenseManager.Validate( this, null, null );
}
public void DoSomething( )
{
if( _license.IsTrial )
MessageBox.Show( "Hello from ProtectedClass, enjoy the trial." );
else
MessageBox.Show( "Hello from ProtectedClass, thanks for your purchase." );
}
}
}
Assembly: DeployLX.Licensing.v5 (in DeployLX.Licensing.v5.dll)