MirraKey is a COM ActiveX library and needs to be added to your project as a Reference and declared to call its methods or set properties.

VB.Net declaration
Dim objMirraKey as New MirraKeyLib.MirraKey
C#.Net declaration
MirraKeyLib.MirraKey objMirraKey = new MirraKeyLib.MirraKey();
Visual Basic 6 declaration
Dim objMirraKey as MirraKey
Set objMirraKey = New MirraKey

Methods with Description and Syntax

AddActivationCode method
Description Add an activation code to Mirrakey's XML license file.  You need to set the ActivationCode property first.  See example below.
Syntax Function AddActivationCode() as Boolean
Returned Value Boolean value True or False
Example Dim objMirrakey As New MirraKeyLib.MirraKey
objMirrakey.CompanyNameFolder = "MyCompanyName"
objMirrakey.ProductNameFolder = "MyAppName"
objMirrakey.EncryptionKey = "MySecretKey"  ' If set this will encrypt the data saved to the license file.
objMirrakey.ActivationCode = "12345 12345 12345 12345"  ' Your Activation Code. Typically, this would be the code generated on your server using your client's license key and a unique identifier from the target computer.
Dim bRet As Boolean = objMirrakey.AddActivationCode() 
objMirrakey = Nothing

 

EncryptString method
Description Return the encrypted value of 'strToEncrypt' using the provided encryption key 'strEncryptionKey'
Syntax Function EncryptString(strToEncrypt, strEncryptionKey) as String
Returned Value String as a Base64-encoded encrypted string or an empty string if an error occurs.
strToEncrypt A string value of the text you want to encrypt.
strEncryptionKey A strng value of the encryption key used to encrypt the data provided.
Example strValue = objMirraKey.EncryptString(strToEncrypt, strEncryptionKey)

 

GenerateKey method
Description Return the license key string generated using one or more of the properties 'ProductName', 'SerialNo' and 'UserName' plus the optional 'Options' property.
Syntax Function GenerateKey() As String
Returned Value Alpha-numeric string of the license key generated or an empty string if an error occurs.
Example objMirraKey.SerialNo = "12345"
strLicenseKey = objMirraKey.GenerateKey()
(You must set one or more of the 'ProductName', 'SerialNo' or 'UserName' properties.)

 

GetFeatures method
Description Return a long integer value from the license key based on the Options property (if any) set when the license key was generated.
Syntax Function GetFeatures() As Long
Returned Value Long integer that can be resolved to return any combination of up to 8 options or features of your software.
Example lngValue = objMirraKey.GetFeatures()

 

GetValueFromLicenseFile method
Description Return the value for any given XMLTag in your license file if you use the in-built license key manager. You need to set the properties for CompanyNameFolder, ProductNameFolder and (if applicable) EncryptionKey.
Syntax Function GetValueFromLicenseFile(sXMLTagName As String) As String
Returned Value String value for the XML tag if found, else and empty string.  An empty string is also returned if the EncryptionKey property is invalid.  This is a versatile method to return the value of any XML tag in the Mirrakey license file.
Example Dim objMirrakey As New MirraKeyLib.MirraKey
objMirrakey.CompanyNameFolder = "MyCompanyName"
objMirrakey.ProductNameFolder = "MyAppName"
objMirrakey.EncryptionKey = "MySecretKey"  ' Only required if you have stored the tag value with encryption.
Dim sXMLTagName as String = "TagName"  ' The tag name to look for.
Dim sValue as String = GetValueFromLicenseFile(sXMLTagName)
objMirrakey = Nothing

 

IsLicensed method
Description Return true or false if your product is licensed and you are using the in-built license key manager. You need to set the properties for CompanyNameFolder, ProductNameFolder and (if applicable) EncryptionKey.
Syntax Function IsLicensed() as Boolean
Returned Value Boolean value True or False
Example Dim objMirrakey As New MirraKeyLib.MirraKey
objMirrakey.CompanyNameFolder = "MyCompanyName"
objMirrakey.ProductNameFolder = "MyAppName"
objMirrakey.EncryptionKey = "MySecretKey"  ' Only required if you have stored the license key and parameters with encryption.
Dim bRet As Boolean = objMirrakey.IsLicensed() 
objMirrakey = Nothing

 

ShowLicenseKeyManager method
Description Display the License Key Manager form which will return your software's registration information or allow you client to enter the License Key and other relevant details to register your software.  The License Key Manager form also includes a 'Purchase' button that links to your website using the 'PurchaseURL' property.
Syntax Sub ShowLicenseKeyManager(bShowProductName As Boolean, bShowSerialNo As Boolean, bShowUserName As Boolean)
Returned Value None
Example bShowProductName = True
bShowSerialNo = True
bShowUserName = True
objMirraKey.ShowLicenseKeyManager(bShowProductName, bShowSerialNo, bShowUserName)

 

ValidateKey method
Description Returns a boolean value True or False based on validating the License Key and relevant 'ProductName', 'SerialNo' and 'UserName' properties.
Syntax Function ValidateKey() as Boolean
Returned Value Boolean value True or False
Example objMirraKey.LicenseKey = strLicenseKey
objMirraKey.SerialNo = strSerialNo
objMirraKey.ProductName = strProductName
objMirraKey.UserName = strUserName
objMirraKey.ValidateKey()