summary refs log tree commit diff
path: root/crypto/src/tls/ClientCertificateType.cs
blob: a37ed0f0538d9b6f4e01921e87e53f30a06d5540 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;

namespace Org.BouncyCastle.Tls
{
    public abstract class ClientCertificateType
    {
        /*
         *  RFC 4346 7.4.4
         */
        public const short rsa_sign = 1;
        public const short dss_sign = 2;
        public const short rsa_fixed_dh = 3;
        public const short dss_fixed_dh = 4;
        public const short rsa_ephemeral_dh_RESERVED = 5;
        public const short dss_ephemeral_dh_RESERVED = 6;
        public const short fortezza_dms_RESERVED = 20;

        /*
         * RFC 4492 5.5
         */
        public const short ecdsa_sign = 64;
        public const short rsa_fixed_ecdh = 65;
        public const short ecdsa_fixed_ecdh = 66;

        /*
         * RFC 9189
         */
        public const short gost_sign256 = 67;
        public const short gost_sign512 = 68;

        public static string GetName(short clientCertificateType)
        {
            switch (clientCertificateType)
            {
            case rsa_sign:
                return "rsa_sign";
            case dss_sign:
                return "dss_sign";
            case rsa_fixed_dh:
                return "rsa_fixed_dh";
            case dss_fixed_dh:
                return "dss_fixed_dh";
            case rsa_ephemeral_dh_RESERVED:
                return "rsa_ephemeral_dh_RESERVED";
            case dss_ephemeral_dh_RESERVED:
                return "dss_ephemeral_dh_RESERVED";
            case fortezza_dms_RESERVED:
                return "fortezza_dms_RESERVED";
            case ecdsa_sign:
                return "ecdsa_sign";
            case rsa_fixed_ecdh:
                return "rsa_fixed_ecdh";
            case ecdsa_fixed_ecdh:
                return "ecdsa_fixed_ecdh";
            case gost_sign256:
                return "gost_sign256";
            case gost_sign512:
                return "gost_sign512";
            default:
                return "UNKNOWN";
            }
        }

        public static string GetText(short clientCertificateType)
        {
            return GetName(clientCertificateType) + "(" + clientCertificateType + ")";
        }
    }
}