source: trunk/CrypPlugins/PKCS1/Library/HashFuncIdentHandler.cs @ 1893

Last change on this file since 1893 was 1778, checked in by schomburg, 11 years ago

renamed some classes for the sake of consistency

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace PKCS1.Library
7{
8    public enum HashFunctionType { SHA1 = 0, SHA256 = 1, SHA384 = 2, SHA512 = 3, MD2 = 4, MD5 = 5 };
9
10    static class HashFuncIdentHandler
11    {
12        public static HashFunctionIdent SHA1 = new HashFunctionIdent(HashFunctionType.SHA1,"SHA-1", "3021300906052B0E03021A05000414", 160);
13        public static HashFunctionIdent SHA256 = new HashFunctionIdent(HashFunctionType.SHA256, "SHA-256", "3031300D060960864801650304020105000420", 256);
14        public static HashFunctionIdent SHA384 = new HashFunctionIdent(HashFunctionType.SHA384, "SHA-384", "3041300D060960864801650304020205000430", 384);
15        public static HashFunctionIdent SHA512 = new HashFunctionIdent(HashFunctionType.SHA512, "SHA-512", "3051300D060960864801650304020305000440", 512);
16        public static HashFunctionIdent MD2 = new HashFunctionIdent(HashFunctionType.MD2, "MD2", "3020300C06082A864886F70D020205000410", 128);
17        public static HashFunctionIdent MD5 = new HashFunctionIdent(HashFunctionType.MD5, "MD5", "3020300C06082A864886F70D020505000410", 128);
18    }
19
20    public class HashFunctionIdent
21    {
22        public string diplayName;
23        public HashFunctionType type;
24        public string DERIdent;
25        public int digestLength;
26
27        public HashFunctionIdent(HashFunctionType hashFuncType, string displayName, string DERIdent, int length)
28        {
29            this.type = hashFuncType;
30            this.diplayName = displayName;
31            this.DERIdent = DERIdent;
32            this.digestLength = length;
33        }
34
35        public override string ToString()
36        {
37            return diplayName;
38        }
39    }
40}
Note: See TracBrowser for help on using the repository browser.