mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +00:00
LibTLS: Move the asn certificate parser to Certificate.cpp
This commit is contained in:
parent
45d55ecacc
commit
17a1f51579
5 changed files with 487 additions and 469 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue