OpenVPN 3 Core Library
Loading...
Searching...
No Matches
pkcs1.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_MBEDTLS_UTIL_PKCS1_H
13#define OPENVPN_MBEDTLS_UTIL_PKCS1_H
14
15#include <openvpn/pki/pkcs1.hpp>
16
18
19class MbedTLSParse : public Parse<mbedtls_md_type_t>
20{
21 public:
23 : Parse(MBEDTLS_MD_NONE,
24 MBEDTLS_MD_MD5,
25 MBEDTLS_MD_SHA1,
26 MBEDTLS_MD_SHA256,
27 MBEDTLS_MD_SHA384,
28 MBEDTLS_MD_SHA512)
29 {
30 }
31
32 static const char *to_string(const mbedtls_md_type_t t)
33 {
34 switch (t)
35 {
36 case MBEDTLS_MD_NONE:
37 return "MBEDTLS_MD_NONE";
38 case MBEDTLS_MD_MD5:
39 return "MBEDTLS_MD_MD5";
40 case MBEDTLS_MD_SHA1:
41 return "MBEDTLS_MD_SHA1";
42 case MBEDTLS_MD_SHA256:
43 return "MBEDTLS_MD_SHA256";
44 case MBEDTLS_MD_SHA384:
45 return "MBEDTLS_MD_SHA384";
46 case MBEDTLS_MD_SHA512:
47 return "MBEDTLS_MD_SHA512";
48 default:
49 return "MBEDTLS_MD_???";
50 }
51 }
52};
53} // namespace openvpn::PKCS1::DigestPrefix
54
55#endif
static const char * to_string(const mbedtls_md_type_t t)
Definition pkcs1.hpp:32