[ActiveLock-Development] CVS: activelock2/src IActiveLock.cls,1.9,1.10
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-08-04 12:37:11
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv24504 Modified Files: IActiveLock.cls Log Message: Corrections to vbdox comments. Index: IActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/IActiveLock.cls,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- IActiveLock.cls 4 Aug 2003 11:54:08 -0000 1.9 +++ IActiveLock.cls 4 Aug 2003 12:37:08 -0000 1.10 @@ -55,13 +55,15 @@ ' <p> ' <b>Important!</b> It is also strongly recommended that a checksum on ActiveLock2.dll be performed ' prior to accessing and interacting with ActiveLock. See sample code below on how it is done. -' <p> The sample code below illustrates of how this interface is used. +' <p> The sample code fragments below illustrate of how this interface is used. Please note that the code shown is +' only for illustration purposes and is not meant to be a complete compilable program. You may have to add +' variable declarations and function definitions around the code fragments before you can compile it. ' <pre> ' Form1.frm: ' ... ' Private MyActiveLock As ActiveLock2.IActiveLock ' Private WithEvents ActiveLockEventSink As ActiveLockEventNotifier -' Private Const AL_CRC& = 308603 '' ActiveLock2.dll's CRC checksum to be used for validation +' Private Const AL_CRC& = 308603 ' ActiveLock2.dll's CRC checksum to be used for validation '<br> ' '' This RSA private key will be used for data encryption and/or license key signing. ' Private Const PRIV_KEY$ = "AAAAgEPRFzhQEF7S91vt2K6kOcEdDDe5BfwNiEL30/+ozTFHc7cZctB8NIlS++ZR//D3AjSMqScjh7xUF/gwvUgGCjiExjj1DF/XWFWnPOCfF8UxYAizCLZ9fdqxb1FRpI5NoW0xxUmvxGjmxKwazIW4P4XVi/+i1Bvh2qQ6ri3whcsNAAAAQQCyWGsbJKO28H2QLYH+enb7ehzwBThqfAeke/Gv1Te95yIAWme71I9aCTTlLsmtIYSk9rNrp3sh9ItD2Re67SE7AAAAQQCAookH1nws1gS2XP9cZTPaZEmFLwuxlSVsLQ5RWmd9cuxpgw5y2gIskbL4c+4oBuj0IDwKtnMrZq7UfV9I5VfVAAAAQQCEnyAuO0ahXH3KhAboop9+tCmRzZInTrDYdMy23xf3PLCLd777dL/Y2Y+zmaH1VO03m6iOog7WLiN4dCL7m+Im" @@ -73,11 +75,11 @@ ' On Error GoTo Hell ' ' Obtain an instance of AL ' Set MyActiveLock = ActiveLock2.NewInstance() -' ' Verify AL's authenticity +' ' 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. +' ' 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 @@ -134,9 +136,9 @@ ' ... ' ' ' ' 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. +' ' 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 @@ -180,7 +182,7 @@ ' <pre> ' ' First, take request code and decode it. ' Dim strReq As String -' strReq = ActiveLock2.Base64Decode(txtReqCodeIn) +' strReq = ActiveLock2.Base64Decode(txtReqCodeIn) ' txtReqCodeIn is a textbox containing the input from the user ' ' strReq now contains the {LockCode + vbLf + User} string ' Dim strLock$, strUser$ ' @@ -209,8 +211,8 @@ ' strEncrypted = ActiveLock2.MD5Hash(strEncrypted) ' ' Dim Lic As ProductLicense -' Set Lic = ActiveLock2.CreateProductLicense(txtName, txtSoftwareCodePub, _ -' txtVersion, MyActiveLock.LockType, MyActiveLock.LicenseType, strUser, strExpire, , strRegDate, strEncrypted) +' Set Lic = ActiveLock2.CreateProductLicense("MyApp", PUB_KEY, +' "1.0", MyActiveLock.LockType, MyActiveLock.LicenseType, strUser, strExpire, , strRegDate, strEncrypted) ' Dim strLic As String ' ' encrypt Product license using LockCode ' strLic = MyActiveLock.LockCode(Lic) @@ -236,7 +238,7 @@ ' ' txtLibKey contains the liberation key entered by the user. ' ' This key could have be sent via an email to the user or a program that automatically ' ' requests the key from a registration website. -' ' Load up the license txtLibKey +' ' Load up the license txtLibKey. ' txtLibKey is a textbox containing the input from the user. ' Lic.Load txtLibKey ' MyActiveLock.Register Lic ' MsgBox "Registration successful!" @@ -444,7 +446,6 @@ ' Performs special initialization before we start operating. Some of the routines, including <code>Acquire()</code> ' and <code>Register()</code> requires Init() to be called first. ' This routine accepts varying number of parameters. -' @todo [th2tran20030720] I can't think of any special initialization that is required right now. But let''s keep this for future use. ' ' @param Arg1 First parameter to be passed to this routine. ' @param OtherArgs The remaining array of arguments to be passed into this routine. |