home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmOption
- BorderStyle = 3 'Fixed Dialog
- Caption = "Options"
- ClientHeight = 1395
- ClientLeft = 0
- ClientTop = 285
- ClientWidth = 5445
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1395
- ScaleWidth = 5445
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin VB.ComboBox cboHashSize
- Height = 315
- Left = 1725
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 525
- Width = 3615
- End
- Begin VB.ComboBox cboHashingMethod
- Height = 315
- Left = 1725
- Style = 2 'Dropdown List
- TabIndex = 0
- Top = 150
- Width = 3615
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 315
- Left = 4200
- TabIndex = 3
- Top = 975
- Width = 1140
- End
- Begin VB.CommandButton cmdOk
- Caption = "Ok"
- Default = -1 'True
- Height = 315
- Left = 3000
- TabIndex = 2
- Top = 975
- Width = 1140
- End
- Begin VB.Label lbl
- Caption = "Hash size"
- Height = 240
- Index = 3
- Left = 150
- TabIndex = 5
- Top = 525
- Width = 1515
- End
- Begin VB.Label lbl
- Caption = "Hashing method"
- Height = 240
- Index = 4
- Left = 150
- TabIndex = 4
- Top = 150
- 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 - Hasher sample
- ' Copyright (c) 2001 Xceed Software Inc.
- ' [Option.frm]
- ' This form module displays available Signing 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 eHashingMethod As enuHashingMethod, _
- ByRef nHashSize As Integer) As Boolean
- Dim I As Long
- 'Fill the Hashing Method combo box
- With cboHashingMethod
- Call .AddItem("SHA", ehmSHA)
- Call .AddItem("Haval", ehmHaval)
- .ListIndex = eHashingMethod
- End With
- DoEvents 'Let the cboHashingMethod_click be handled
- For I = 0 To cboHashSize.ListCount
- If cboHashSize.ItemData(I) = nHashSize Then
- cboHashSize.ListIndex = I
- Exit For
- End If
- Next I
- Call Me.Show(vbModal)
- If m_bOk Then
- 'The user clicked OK : return the chosen values
- eHashingMethod = cboHashingMethod.ListIndex
- nHashSize = cboHashSize.ItemData(cboHashSize.ListIndex)
- End If
- ShowForm = m_bOk
- Call Unload(Me)
- End Function
- Private Sub cboHashingMethod_Click()
- With cboHashSize
- Call .Clear
- Select Case cboHashingMethod.ListIndex
- Case ehmHaval
- Call .AddItem("128")
- .ItemData(.ListCount - 1) = 128
- Call .AddItem("160")
- .ItemData(.ListCount - 1) = 160
- Call .AddItem("192")
- .ItemData(.ListCount - 1) = 192
- Call .AddItem("224")
- .ItemData(.ListCount - 1) = 224
- Call .AddItem("256")
- .ItemData(.ListCount - 1) = 256
- Case ehmSHA
- Call .AddItem("160")
- .ItemData(.ListCount - 1) = 160
- Call .AddItem("256")
- .ItemData(.ListCount - 1) = 256
- Call .AddItem("384")
- .ItemData(.ListCount - 1) = 384
- Call .AddItem("512")
- .ItemData(.ListCount - 1) = 512
- End Select
- .ListIndex = 0
- End With
- End Sub
- Private Sub cmdCancel_Click()
- Call Me.Hide
- End Sub
- Private Sub cmdOk_Click()
- m_bOk = True
- Call SaveHashingSetting
- 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
- '------------------------------------------------------------------------------------
- 'Save the current private key file name
- '------------------------------------------------------------------------------------
- Private Sub SaveHashingSetting()
- Call SaveSetting("XceedHasher", "Hashing", "HashingMethod", cboHashingMethod.ListIndex)
- Call SaveSetting("XceedHasher", "Hashing", "HashSize", cboHashSize.ItemData(cboHashSize.ListIndex))
- End Sub
-