home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncryption.Cab / F112957_Option.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-06-06  |  6.6 KB  |  206 lines

  1. VERSION 5.00
  2. Begin VB.Form frmOption 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Options"
  5.    ClientHeight    =   2505
  6.    ClientLeft      =   0
  7.    ClientTop       =   285
  8.    ClientWidth     =   5355
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2505
  13.    ScaleWidth      =   5355
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.ComboBox cboHashingMethod 
  17.       Height          =   315
  18.       Left            =   1650
  19.       Style           =   2  'Dropdown List
  20.       TabIndex        =   6
  21.       Top             =   1275
  22.       Width           =   3615
  23.    End
  24.    Begin VB.ComboBox cboPaddingMethod 
  25.       Height          =   315
  26.       Left            =   1650
  27.       Style           =   2  'Dropdown List
  28.       TabIndex        =   7
  29.       Top             =   1650
  30.       Width           =   3615
  31.    End
  32.    Begin VB.ComboBox cboEncryptionMethod 
  33.       Height          =   315
  34.       Left            =   1650
  35.       Style           =   2  'Dropdown List
  36.       TabIndex        =   1
  37.       Top             =   150
  38.       Width           =   3615
  39.    End
  40.    Begin VB.ComboBox cboKeySize 
  41.       Height          =   315
  42.       Left            =   1650
  43.       Style           =   2  'Dropdown List
  44.       TabIndex        =   5
  45.       Top             =   900
  46.       Width           =   3615
  47.    End
  48.    Begin VB.ComboBox cboEncryptionMode 
  49.       Height          =   315
  50.       Left            =   1650
  51.       Style           =   2  'Dropdown List
  52.       TabIndex        =   3
  53.       Top             =   525
  54.       Width           =   3615
  55.    End
  56.    Begin VB.CommandButton cmdCancel 
  57.       Cancel          =   -1  'True
  58.       Caption         =   "Cancel"
  59.       Height          =   315
  60.       Left            =   4125
  61.       TabIndex        =   9
  62.       Top             =   2100
  63.       Width           =   1140
  64.    End
  65.    Begin VB.CommandButton cmdOk 
  66.       Caption         =   "Ok"
  67.       Default         =   -1  'True
  68.       Height          =   315
  69.       Left            =   2925
  70.       TabIndex        =   8
  71.       Top             =   2100
  72.       Width           =   1140
  73.    End
  74.    Begin VB.Label lbl 
  75.       Caption         =   "Hashing method"
  76.       Height          =   240
  77.       Index           =   4
  78.       Left            =   75
  79.       TabIndex        =   11
  80.       Top             =   1275
  81.       Width           =   1515
  82.    End
  83.    Begin VB.Label lbl 
  84.       Caption         =   "Padding method"
  85.       Height          =   240
  86.       Index           =   1
  87.       Left            =   75
  88.       TabIndex        =   10
  89.       Top             =   1650
  90.       Width           =   1515
  91.    End
  92.    Begin VB.Label lbl 
  93.       Caption         =   "Encryption method"
  94.       Height          =   240
  95.       Index           =   0
  96.       Left            =   75
  97.       TabIndex        =   0
  98.       Top             =   150
  99.       Width           =   1515
  100.    End
  101.    Begin VB.Label lbl 
  102.       Caption         =   "Key size"
  103.       Height          =   240
  104.       Index           =   3
  105.       Left            =   75
  106.       TabIndex        =   4
  107.       Top             =   900
  108.       Width           =   1515
  109.    End
  110.    Begin VB.Label lbl 
  111.       Caption         =   "Encryption mode"
  112.       Height          =   240
  113.       Index           =   2
  114.       Left            =   75
  115.       TabIndex        =   2
  116.       Top             =   525
  117.       Width           =   1515
  118.    End
  119. Attribute VB_Name = "frmOption"
  120. Attribute VB_GlobalNameSpace = False
  121. Attribute VB_Creatable = False
  122. Attribute VB_PredeclaredId = True
  123. Attribute VB_Exposed = False
  124. ' Xceed Encryption Library - Encryption Manager sample
  125. ' Copyright (c) 2001 Xceed Software Inc.
  126. ' [Option.frm]
  127. ' This form module displays available encryption options.
  128. ' This file is part of the Xceed Encryption Library sample applications.
  129. ' The source code in this file is only intended as a supplement to Xceed
  130. ' Encryption Library's documentation, and is provided "as is", without
  131. ' warranty of any kind, either expressed or implied.
  132. Option Explicit
  133. Private m_bOk As Boolean
  134. Public Function ShowForm(ByRef eEncryptionMethod As enuEncryptionMethod, _
  135.                          ByRef eEncryptionMode As EXEEncryptionMode, _
  136.                          ByRef ePaddingMethod As EXEPaddingMethod, _
  137.                          ByRef eHashingMethod As enuHashingMethod, _
  138.                          ByRef lKeySize As Integer) As Boolean
  139.     Dim I As Long
  140.     'Fill the Encryption Method combo box
  141.     With cboEncryptionMethod
  142.         Call .AddItem("Rijndael (AES)", eemRijndael)
  143.         Call .AddItem("Two-Fish", eemTwoFish)
  144.         .ListIndex = eEncryptionMethod
  145.     End With
  146.     'Fill the Encryption Mode combo box
  147.     With cboEncryptionMode
  148.         Call .AddItem("Free blocks (ECB)", emoFreeBlocks)
  149.         Call .AddItem("Chained blocks (CBC)", emoChainedBlocks)
  150.         .ListIndex = eEncryptionMode
  151.     End With
  152.     'Fill the Padding Method combo box
  153.     With cboPaddingMethod
  154.         Call .AddItem("FIPS-81", epmFIPS81)
  155.         Call .AddItem("Random", epmRandom)
  156.         Call .AddItem("RFC-1423", epmRFC1423)
  157.         .ListIndex = ePaddingMethod
  158.     End With
  159.     'Fill the Hashing Method combo box
  160.     With cboHashingMethod
  161.         Call .AddItem("SHA", ehmSHA)
  162.         Call .AddItem("Haval", ehmHaval)
  163.         .ListIndex = eHashingMethod
  164.     End With
  165.     'Fill the Key size combo box to the 3 accepted values of the
  166.     'Xceed Encryption library
  167.     With cboKeySize
  168.         Call .AddItem("128")
  169.         .ItemData(.ListCount - 1) = 128
  170.         Call .AddItem("192")
  171.         .ItemData(.ListCount - 1) = 192
  172.         Call .AddItem("256")
  173.         .ItemData(.ListCount - 1) = 256
  174.         
  175.         For I = 0 To .ListCount - 1
  176.             If .ItemData(I) = lKeySize Then
  177.                 .ListIndex = I
  178.             End If
  179.         Next I
  180.     End With
  181.     Call Me.Show(vbModal)
  182.     If m_bOk Then
  183.         'The user clicked OK : return the chosen values
  184.         eEncryptionMethod = cboEncryptionMethod.ListIndex
  185.         eEncryptionMode = cboEncryptionMode.ListIndex
  186.         ePaddingMethod = cboPaddingMethod.ListIndex
  187.         eHashingMethod = cboHashingMethod.ListIndex
  188.         lKeySize = cboKeySize.ItemData(cboKeySize.ListIndex)
  189.     End If
  190.     ShowForm = m_bOk
  191.     Call Unload(Me)
  192. End Function
  193. Private Sub cmdOk_Click()
  194.     m_bOk = True
  195.     Call Me.Hide
  196. End Sub
  197. Private Sub cmdCancel_Click()
  198.     Call Me.Hide
  199. End Sub
  200. Private Sub Form_Load()
  201.     m_bOk = False
  202. End Sub
  203. Private Sub Form_Unload(Cancel As Integer)
  204.     Call cmdCancel_Click
  205. End Sub
  206.