summary refs log tree commit diff
path: root/crypto/src/tls/PskKeyExchangeMode.cs
blob: 565745b67ba3b17503e0374382c2d26fcf0a8fb2 (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
using System;

namespace Org.BouncyCastle.Tls
{
    public abstract class PskKeyExchangeMode
    {
        /*
         * RFC 8446
         */

        public const short psk_ke = 0;
        public const short psk_dhe_ke = 1;

        public static string GetName(short pskKeyExchangeMode)
        {
            switch (pskKeyExchangeMode)
            {
            case psk_ke:
                return "psk_ke";
            case psk_dhe_ke:
                return "psk_dhe_ke";
            default:
                return "UNKNOWN";
            }
        }

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