[ActiveLock-Development] CVS: activelock2/src ActiveLockEventNotifier.cls,1.4,1.5 Globals.cls,1.12,1
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-08-03 09:01:09
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv10625 Modified Files: ActiveLockEventNotifier.cls Globals.cls IActiveLock.cls IKeyStoreProvider.cls ProductLicense.cls Log Message: Minor change: Use HTML code ' in place of ' in comment. Index: ActiveLockEventNotifier.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLockEventNotifier.cls,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ActiveLockEventNotifier.cls 3 Aug 2003 08:38:11 -0000 1.4 +++ ActiveLockEventNotifier.cls 3 Aug 2003 09:01:04 -0000 1.5 @@ -43,11 +43,10 @@ '* '' -' This class handles COM event notifications to the interested observers. +' This class handles ActiveLock COM event notifications to the interested observers. ' It is simply a wrapper containing pubic events. These events should -' really belong in IActiveLock, but since VB doesn't support inheritance -' of events, meaning ActiveLock class can't raise IActiveLock events, we -' have to do it this way. +' really belong in IActiveLock, but since VB doesn't support inheritance +' of events, we have to do it this way. ' ' @author th...@us... ' @version 2.0.0 @@ -62,10 +61,12 @@ ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// -' +' @history +' <pre> ' 07.20.03 - th2tran - Created -' -' +' 08.03.03 - th2tran - VBDox'ed this interface. +' </pre> + ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / ' /////////////////////////////////////////////////////////////////////// Index: Globals.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/Globals.cls,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Globals.cls 3 Aug 2003 08:38:11 -0000 1.12 +++ Globals.cls 3 Aug 2003 09:01:04 -0000 1.13 @@ -71,7 +71,7 @@ ' 07.31.03 - th2tran - Added alerrFileTampered ' - CreateProductLicense() to ignore Expiration date ' for Permanent license type -' 08.03.03 - th2tran - VBDox'ed this class. +' 08.03.03 - th2tran - VBDox'ed this class. ' </pre> ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / @@ -131,7 +131,7 @@ ' @param RegisteredDate Date on which the product is registered ' @param Hash1 Hash-1 code ' -Public Function CreateProductLicense(Name As String, _ +Public Function CreateProductLicense(name As String, _ Code As String, _ Ver As String, _ LicClass As ActiveLock2.ALLockTypes, _ @@ -144,7 +144,7 @@ ) As ProductLicense Dim NewLic As New ProductLicense With NewLic - .ProductName = Name + .ProductName = name .ProductKey = Code .ProductVer = Ver .LicenseClass = GetClassString(LicClass) @@ -231,15 +231,15 @@ ' @param strData Data to be signed ' @return Signature string. ' -Public Function RSASign(strPub As String, strPriv As String, strData As String) As String +Public Function RSASign(strPub As String, strPriv As String, strdata As String) As String Dim Key As RSAKey ' create the key from the key blobs modActiveLock.rsa_createkey strPub, Len(strPub), strPriv, Len(strPriv), Key ' sign the data using the created key Dim sLen& - rsa_sign Key, strData, Len(strData), vbNullString, sLen + rsa_sign Key, strdata, Len(strdata), vbNullString, sLen Dim strSig As String: strSig = String(sLen, 0) - modActiveLock.rsa_sign Key, strData, Len(strData), strSig, sLen + modActiveLock.rsa_sign Key, strdata, Len(strdata), strSig, sLen ' throw away the key modActiveLock.rsa_freekey Key RSASign = strSig @@ -252,13 +252,13 @@ ' @param strSig Private key blob ' @return Zero if verification is successful; Non-zero otherwise. ' -Public Function RSAVerify(strPub As String, strData As String, strSig As String) As Long +Public Function RSAVerify(strPub As String, strdata As String, strSig As String) As Long Dim Key As RSAKey Dim rc& ' create the key from the public key blob rsa_createkey strPub, Len(strPub), vbNullString, 0, Key ' validate the key - rc = rsa_verifysig(Key, strSig, Len(strSig), strData, Len(strData)) + rc = rsa_verifysig(Key, strSig, Len(strSig), strdata, Len(strdata)) ' de-allocate memory used by the key rsa_freekey Key RSAVerify = rc Index: IActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/IActiveLock.cls,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- IActiveLock.cls 3 Aug 2003 08:38:11 -0000 1.7 +++ IActiveLock.cls 3 Aug 2003 09:01:04 -0000 1.8 @@ -71,13 +71,13 @@ ' ... ' Private Sub Form_Load() ' On Error GoTo Hell -' '' Obtain an instance of AL +' ' Obtain an instance of AL ' Set MyActiveLock = ActiveLock2.NewInstance() -' '' Verify AL's authenticity -' '' modActiveLock.CRCCheckSumTypeLib() requires a public-creatable object to be passed in so that it can -' '' determine the Type Library DLL on which to perform the checksum. -' '' So can't use MyActiveLock object to authenticate since it is not a public creatable object. -' '' So we'll use ActiveLock2.Globals, which is just as good because they are in the same DLL. +' ' Verify AL's authenticity +' ' modActiveLock.CRCCheckSumTypeLib() requires a public-creatable object to be passed in so that it can +' ' determine the Type Library DLL on which to perform the checksum. +' ' So can't use MyActiveLock object to authenticate since it is not a public creatable object. +' ' So we'll use ActiveLock2.Globals, which is just as good because they are in the same DLL. ' Dim crc As Long ' crc = modActiveLock.CRCCheckSumTypeLib(New ActiveLock2.Globals) ' Debug.Print "Hash: " & crc @@ -85,76 +85,76 @@ ' MsgBox "ActiveLock2.dll has been corrupted. If you were running a real application, it should terminate at this point." ' End If '<br> -' '' Initialize the keystore. We use a File keystore in this case. +' ' Initialize the keystore. We use a File keystore in this case. ' MyActiveLock.KeyStoreType = alsFile ' MyActiveLock.KeyStorePath = App.path & "\al.lic" '<br> -' '' Obtain the EventNotifier so that we can receive notifications from AL. +' ' Obtain the EventNotifier so that we can receive notifications from AL. ' Set ActiveLockEventSink = MyActiveLock.EventNotifier '<br> -' '' Specify the name of the product that will be locked through AL. +' ' Specify the name of the product that will be locked through AL. ' MyActiveLock.SoftwareName = "MyApp" '<br> -' '' Specify our product code. This is a RSA public key, which will be used later by ActiveLock to validate license signatures +' ' Specify our product code. This is a RSA public key, which will be used later by ActiveLock to validate license signatures ' MyActiveLock.SoftwareCode = "AAAAB3NzaC1yc2EAAAABJQAAAIBZnXD4IKfrBH25ekwLWQMs5mJuNH7D7U99EKFIsVhKQv17GHxKWvxHv/FwWhI1Rmd8TCiqk4Wmk7H1rh6xdbIVBwDj+RSeiXs8mmQX4/XvaWZx9BIQr5wODWnQCH/tj6Y6In2Xjc2J3B7LSjD60cWDBY/u+z9cSheTHLyhb16zFw==" '<br> -' '' Specify product version +' ' Specify product version ' MyActiveLock.SoftwareVersion = txtVersion '<br> -' '' Specify License Type +' ' Specify License Type ' MyActiveLock.LicenseType = allicTimeLocked '<br> -' '' Specify Lock Type +' ' Specify Lock Type ' MyActiveLock.LockType = lockHD '<br> -' '' Now initialize AL +' ' Now initialize AL ' MyActiveLock.Init '<br> -' '' At this point, either AL has been initialized or an error would have already been raised -' '' if there were problems (such as the DLL has been tampered). +' ' At this point, either AL has been initialized or an error would have already been raised +' ' if there were problems (such as the DLL has been tampered). '<br> -' '' Check registration status by calling Acquire() -' '' Note: Calling Acquire() may trigger ActiveLockEventNotifier_ValidateValue() event. -' '' So we must be prepared to handle that. -' MyActiveLock.Acquire +' ' Check registration status by calling Acquire() +' ' Note: Calling Acquire() may trigger ActiveLockEventNotifier_ValidateValue() event. +' ' So we must be prepared to handle that. +' MyActiveLock.Acquire '<br> -' '' By now, if the product is not registered, then an error whould have been raised, -' '' which means if we get to here, then we're registered. +' ' By now, if the product is not registered, then an error whould have been raised, +' ' which means if we get to here, then we're registered. '<br> -' '' Just for fun, print out some registration status info +' ' Just for fun, print out some registration status info ' Debug.Print "Used Days: " & MyActiveLock.UsedDays ' Debug.Print "Expiration Date: " & MyActiveLock.ExpirationDate ' Exit Sub ' Hell: ' MsgBox Err.Number & ": " & Err.Description -' '' End program +' ' End program ' End ' End Sub ' ... ' ... -' '' -' '' ActiveLock raises this event typically when it needs a value to be encrypted. -' '' We can use any kind of encryption we'd like here, as long as it's deterministic. -' '' i.e. there's a one-to-one correspondence between unencrypted value and encrypted value. -' '' NOTE: BlowFish is NOT an example of deterministic encryption so you can't use it here. +' ' +' ' ActiveLock raises this event typically when it needs a value to be encrypted. +' ' We can use any kind of encryption we'd like here, as long as it's deterministic. +' ' i.e. there's a one-to-one correspondence between unencrypted value and encrypted value. +' ' NOTE: BlowFish is NOT an example of deterministic encryption so you can't use it here. ' Private Sub ActiveLockEventSink_ValidateValue(ByVal Value As String, Result As String) ' Result = Encrypt(Value) ' End Sub '<br> -' '' Encrypts a string. +' ' Encrypts a string. ' Private Function Encrypt(strData As String) As String ' Dim Key As RSAKey -' '' create the key from the key blobs +' ' create the key from the key blobs ' modActiveLock.rsa_createkey PUB_KEY, Len(PUB_KEY), PRIV_KEY, Len(PRIV_KEY), Key '<br> -' '' sign the data using the created key +' ' sign the data using the created key ' Dim dLen& ' Dim strEnc As String * 255 ' strEnc = strData ' dLen = Len(strData) ' modActiveLock.rsa_encrypt 1, strEnc, dLen, Key '<br> -' '' done with the key - throw it away +' ' done with the key - throw it away ' modActiveLock.rsa_freekey Key '<br> ' Dim strOut As String @@ -179,7 +179,7 @@ ' <pre> ' 07.07.03 - mcrute - Updated the header comments for this file. ' 07.20.03 - th2tran - Added EventNotifier used for firing COM events. -' 08.03.03 - th2tran - VBDox'ed this interface. +' 08.03.03 - th2tran - VBDox'ed this interface. ' ' </pre> @@ -190,7 +190,7 @@ Option Explicit '' -' License Types. Values are mutually exclusive. i.e. they cannot be OR'd together. +' License Types. Values are mutually exclusive. i.e. they cannot be OR'd together. ' ' @param allicNone Not licensed ' @param allicPeriodic License expires after X number of days @@ -204,7 +204,7 @@ End Enum '' -' License Lock Types. Values can be combined (OR''ed) together. +' License Lock Types. Values can be combined (OR'ed) together. ' ' @param lockNone No locking - not recommended ' @param lockWindows Lock to windows serial number @@ -222,7 +222,7 @@ End Enum '' -' License Flags. Values can be combined (OR''ed) together. +' License Flags. Values can be combined (OR'ed) together. ' ' @param alfSingle Single-user license ' @param alfMulti Multi-user license @@ -325,7 +325,7 @@ ' @param Path The path to be used for the specified KeyStoreType. ' e.g. If <code>alsFile</code> is used for <code>KeyStoreType</code>, then Path specifies the path to the license file. ' If <code>alsRegistry</code> is used for <code>KeyStoreType</code>, the Path specifies the Registry hive where license information is stored. -Public Property Let KeyStorePath(Path As String) +Public Property Let KeyStorePath(path As String) End Property Index: IKeyStoreProvider.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/IKeyStoreProvider.cls,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- IKeyStoreProvider.cls 3 Aug 2003 08:38:11 -0000 1.6 +++ IKeyStoreProvider.cls 3 Aug 2003 09:01:04 -0000 1.7 @@ -64,7 +64,7 @@ ' @history ' <pre> ' 07.07.03 - mcrute - Updated the header comments for this file. -' 08.03.03 - th2tran - VBDox'ed this class. +' 08.03.03 - th2tran - VBDox'ed this class. ' </pre> ' /////////////////////////////////////////////////////////////////////// @@ -77,7 +77,7 @@ ' Example: path to a license file, or path to the Windows Registry hive. ' @param Path Key store path. ' -Public Property Let KeyStorePath(Path As String) +Public Property Let KeyStorePath(path As String) End Property Index: ProductLicense.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ProductLicense.cls,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ProductLicense.cls 3 Aug 2003 08:38:11 -0000 1.5 +++ ProductLicense.cls 3 Aug 2003 09:01:04 -0000 1.6 @@ -63,7 +63,7 @@ ' <pre> ' 06.16.03 - th2tran - created ' 07.07.03 - mecrute - Updated the header comments for this file. -' 08.03.03 - th2tran - VBDox'ed this class. +' 08.03.03 - th2tran - VBDox'ed this class. ' </pre> @@ -102,8 +102,8 @@ '' ' [INTERNAL] Specifies product name. ' -Friend Property Let ProductName(Name As String) - mstrProductName = Name +Friend Property Let ProductName(name As String) + mstrProductName = name End Property '' @@ -176,8 +176,8 @@ '' ' [INTERNAL] Specifies the licensed user. ' -Friend Property Let Licensee(Name As String) - mstrLicensee = Name +Friend Property Let Licensee(name As String) + mstrLicensee = name End Property '' |