Xceed Encryption Library Documentation
License method
Xceed Encryption control reference > Methods > License method

Description

The License method must be called to license the library for runtime use. This applies to both registered users as well as users of the time-limited free trial version.

If you do not call this method, Xceed Encryption / Xceed Hashing / Xceed Signing object's method calls will not work and will immediately return the eerNotLicensed error code.

When to call the License method

The License method must be the first method you call after instantiating the component, hashing or signing objects and/or before any other methods are called. For example:

VB.NET Copy Code

Dim WithEvents m_xCry As XceedEncryption
Dim bReturn As Boolean 

Set m_xCry = new XceedEncryption
bReturn = m_xCry.License( "Your license string goes here" ) 

If ( bReturn = False ) Then 
  Call MsgBox( "Xceed Encryption is not licensed for distribution!!" )
End If

Parameters 

Parameter Description
sLicense Provide your license key here. Both registered users and trial version users have a license key. This key can be found by selecting the Start -> Programs -> Xceed Components -> Xceed Component Licenser menu item. Trial version keys are time-limited and will not work after the trial period has ended.

Return values

Returns True if the license key was accepted, False if the license key was invalid.

Remarks

The License method is required because instantiation methods such as CreateObject() and CoCreateInstance() do not cooperate with the licensing scheme provided by IClassFactory2.

Declaration (DXceedEncryption) Copy Code
HRESULT License( [in] BSTR sLicense, [out,retval] VARIANT_BOOL* pbSucceeded ) 
Declaration (IXceedEncryption) Copy Code

HRESULT License( [in] BSTR sLicense, [out,retval] BOOL* pbSucceeded )