1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibTLS: Move the asn certificate parser to Certificate.cpp

This commit is contained in:
DexesTTP 2021-05-17 20:40:45 +02:00 committed by Andreas Kling
parent 45d55ecacc
commit 17a1f51579
5 changed files with 487 additions and 469 deletions

View file

@ -8,6 +8,7 @@
#include <AK/ByteBuffer.h>
#include <AK/Forward.h>
#include <AK/Optional.h>
#include <AK/Singleton.h>
#include <AK/Types.h>
#include <LibCore/DateTime.h>
@ -25,7 +26,8 @@ enum class CertificateKeyAlgorithm {
RSA_SHA512 = 0x0d,
};
struct Certificate {
class Certificate {
public:
u16 version { 0 };
CertificateKeyAlgorithm algorithm { CertificateKeyAlgorithm::Unsupported };
CertificateKeyAlgorithm key_algorithm { CertificateKeyAlgorithm::Unsupported };
@ -51,6 +53,8 @@ struct Certificate {
ByteBuffer der {};
ByteBuffer data {};
static Optional<Certificate> parse_asn1(ReadonlyBytes, bool client_cert = false);
bool is_valid() const;
};