source: trunk/CrypPlugins/HMAC/HMACSettings.cs @ 2061

Last change on this file since 2061 was 777, checked in by Matthäus Wander, 12 years ago
  • enabled more generic usage of ArrayIndexer and LengthOf
  • added ArrayIndexer, HMAC, LengthOf to setup
File size: 2.3 KB
Line 
1/*
2   Copyright 2009 Holger Pretzsch, University of Duisburg-Essen
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21using Cryptool.PluginBase;
22using System.ComponentModel;
23
24namespace Cryptool.HMAC
25{
26    class HMACSettings : ISettings
27    {
28        public enum HashFunction { MD5, RIPEMD160, SHA1, SHA256, SHA384, SHA512 };
29
30        private HashFunction selectedHashFunction = HashFunction.MD5;
31
32        [ContextMenu("Hash Function", "Select the hash function to use for the message digest", 1, DisplayLevel.Beginner, ContextMenuControlType.ComboBox, null, new string[] { "MD5", "RIPEMD160", "SHA1", "SHA256", "SHA384", "SHA512" })]
33        [TaskPane("Hash Function", "Select the hash function to use for the message digest", "", 1, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "MD5", "RIPEMD160", "SHA1", "SHA256", "SHA384", "SHA512" })]
34        public int SelectedHashFunction
35        {
36            get { return (int)this.selectedHashFunction; }
37            set
38            {
39                this.selectedHashFunction = (HashFunction)value;
40                OnPropertyChanged("SelectedHashFunction");
41            }
42        }
43
44        #region INotifyPropertyChanged Members
45
46#pragma warning disable 67
47        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
48#pragma warning restore
49
50        protected void OnPropertyChanged(string name)
51        {
52            if (PropertyChanged != null)
53            {
54                PropertyChanged(this, new PropertyChangedEventArgs(name));
55            }
56        }
57       
58        #endregion
59
60        #region ISettings Members
61
62        public bool HasChanges { get; set; }
63
64        #endregion
65    }
66}
Note: See TracBrowser for help on using the repository browser.