home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmOption
- BorderStyle = 3 'Fixed Dialog
- Caption = "Options"
- ClientHeight = 2505
- ClientLeft = 0
- ClientTop = 285
- ClientWidth = 5355
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2505
- ScaleWidth = 5355
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin VB.ComboBox cboHashingMethod
- Height = 315
- Left = 1650
- Style = 2 'Dropdown List
- TabIndex = 6
- Top = 1275
- Width = 3615
- End
- Begin VB.ComboBox cboPaddingMethod
- Height = 315
- Left = 1650
- Style = 2 'Dropdown List
- TabIndex = 7
- Top = 1650
- Width = 3615
- End
- Begin VB.ComboBox cboEncryptionMethod
- Height = 315
- Left = 1650
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 150
- Width = 3615
- End
- Begin VB.ComboBox cboKeySize
- Height = 315
- Left = 1650
- Style = 2 'Dropdown List
- TabIndex = 5
- Top = 900
- Width = 3615
- End
- Begin VB.ComboBox cboEncryptionMode
- Height = 315
- Left = 1650
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 525
- Width = 3615
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 315
- Left = 4125
- TabIndex = 9
- Top = 2100
- Width = 1140
- End
- Begin VB.CommandButton cmdOk
- Caption = "Ok"
- Default = -1 'True
- Height = 315
- Left = 2925
- TabIndex = 8
- Top = 2100
- Width = 1140
- End
- Begin VB.Label lbl
- Caption = "Hashing method"
- Height = 240
- Index = 4
- Left = 75
- TabIndex = 11
- Top = 1275
- Width = 1515
- End
- Begin VB.Label lbl
- Caption = "Padding method"
- Height = 240
- Index = 1
- Left = 75
- TabIndex = 10
- Top = 1650
- Width = 1515
- End
- Begin VB.Label lbl
- Caption = "Encryption method"
- Height = 240
- Index = 0
- Left = 75
- TabIndex = 0
- Top = 150
- Width = 1515
- End
- Begin VB.Label lbl
- Caption = "Key size"
- Height = 240
- Index = 3
- Left = 75
- TabIndex = 4
- Top = 900
- Width = 1515
- End
- Begin VB.Label lbl
- Caption = "Encryption mode"
- Height = 240
- Index = 2
- Left = 75
- TabIndex = 2
- Top = 525
- Width = 1515
- End
- Attribute VB_Name = "frmOption"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' Xceed Encryption Library - Encryption Manager sample
- ' Copyright (c) 2001 Xceed Software Inc.
- ' [Option.frm]
- ' This form module displays available encryption options.
- ' This file is part of the Xceed Encryption Library sample applications.
- ' The source code in this file is only intended as a supplement to Xceed
- ' Encryption Library's documentation, and is provided "as is", without
- ' warranty of any kind, either expressed or implied.
- Option Explicit
- Private m_bOk As Boolean
- Public Function ShowForm(ByRef eEncryptionMethod As enuEncryptionMethod, _
- ByRef eEncryptionMode As EXEEncryptionMode, _
- ByRef ePaddingMethod As EXEPaddingMethod, _
- ByRef eHashingMethod As enuHashingMethod, _
- ByRef lKeySize As Integer) As Boolean
- Dim I As Long
- 'Fill the Encryption Method combo box
- With cboEncryptionMethod
- Call .AddItem("Rijndael (AES)", eemRijndael)
- Call .AddItem("Two-Fish", eemTwoFish)
- .ListIndex = eEncryptionMethod
- End With
- 'Fill the Encryption Mode combo box
- With cboEncryptionMode
- Call .AddItem("Free blocks (ECB)", emoFreeBlocks)
- Call .AddItem("Chained blocks (CBC)", emoChainedBlocks)
- .ListIndex = eEncryptionMode
- End With
- 'Fill the Padding Method combo box
- With cboPaddingMethod
- Call .AddItem("FIPS-81", epmFIPS81)
- Call .AddItem("Random", epmRandom)
- Call .AddItem("RFC-1423", epmRFC1423)
- .ListIndex = ePaddingMethod
- End With
- 'Fill the Hashing Method combo box
- With cboHashingMethod
- Call .AddItem("SHA", ehmSHA)
- Call .AddItem("Haval", ehmHaval)
- .ListIndex = eHashingMethod
- End With
- 'Fill the Key size combo box to the 3 accepted values of the
- 'Xceed Encryption library
- With cboKeySize
- Call .AddItem("128")
- .ItemData(.ListCount - 1) = 128
- Call .AddItem("192")
- .ItemData(.ListCount - 1) = 192
- Call .AddItem("256")
- .ItemData(.ListCount - 1) = 256
-
- For I = 0 To .ListCount - 1
- If .ItemData(I) = lKeySize Then
- .ListIndex = I
- End If
- Next I
- End With
- Call Me.Show(vbModal)
- If m_bOk Then
- 'The user clicked OK : return the chosen values
- eEncryptionMethod = cboEncryptionMethod.ListIndex
- eEncryptionMode = cboEncryptionMode.ListIndex
- ePaddingMethod = cboPaddingMethod.ListIndex
- eHashingMethod = cboHashingMethod.ListIndex
- lKeySize = cboKeySize.ItemData(cboKeySize.ListIndex)
- End If
- ShowForm = m_bOk
- Call Unload(Me)
- End Function
- Private Sub cmdOk_Click()
- m_bOk = True
- Call Me.Hide
- End Sub
- Private Sub cmdCancel_Click()
- Call Me.Hide
- End Sub
- Private Sub Form_Load()
- m_bOk = False
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Call cmdCancel_Click
- End Sub
-