Skip to content

Commit 07ced0c

Browse files
devgianluawesomekling
authored andcommitted
LibCrypto: Make PEMType an enum class
This is required for the following commits to avoid a conflict with the `Certificate` namespace.
1 parent 03b9e55 commit 07ced0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Libraries/LibCrypto/ASN1/PEM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ ErrorOr<ByteBuffer> encode_pem(ReadonlyBytes data, PEMType type)
100100
StringView block_end;
101101

102102
switch (type) {
103-
case Certificate:
103+
case PEMType::Certificate:
104104
block_start = "-----BEGIN CERTIFICATE-----\n"sv;
105105
block_end = "-----END CERTIFICATE-----\n"sv;
106106
break;
107-
case PrivateKey:
107+
case PEMType::PrivateKey:
108108
block_start = "-----BEGIN PRIVATE KEY-----\n"sv;
109109
block_end = "-----END PRIVATE KEY-----\n"sv;
110110
break;

Libraries/LibCrypto/ASN1/PEM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Crypto {
1313

14-
enum PEMType {
14+
enum class PEMType {
1515
Certificate,
1616
PrivateKey,
1717
};

0 commit comments

Comments
 (0)