LibTLS: Export parse_subject_public_key_info

LibWeb wants to call this for Web Crypto.
This commit is contained in:
Andrew Kaster 2024-03-14 21:54:51 -06:00 committed by Andrew Kaster
parent e422c93537
commit 7b27c1ce6c
Notes: sideshowbarker 2024-07-17 07:43:44 +09:00
2 changed files with 3 additions and 4 deletions

View file

@ -349,7 +349,7 @@ static ErrorOr<Validity> parse_validity(Crypto::ASN1::Decoder& decoder, Vector<S
return validity;
}
static ErrorOr<SubjectPublicKey> parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)
ErrorOr<SubjectPublicKey> parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)
{
// SubjectPublicKeyInfo ::= Sequence {
// algorithm AlgorithmIdentifier,
@ -387,9 +387,6 @@ static ErrorOr<SubjectPublicKey> parse_subject_public_key_info(Crypto::ASN1::Dec
String algo_oid = TRY(String::join("."sv, public_key.algorithm.identifier));
ERROR_WITH_SCOPE(TRY(String::formatted("Unhandled algorithm {}", algo_oid)));
EXIT_SCOPE();
return public_key;
}
static ErrorOr<Crypto::ASN1::BitStringView> parse_unique_identifier(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)

View file

@ -12,6 +12,7 @@
#include <AK/Time.h>
#include <AK/Types.h>
#include <LibCore/ConfigFile.h>
#include <LibCrypto/ASN1/DER.h>
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
#include <LibCrypto/PK/RSA.h>
#include <LibTLS/Extensions.h>
@ -244,6 +245,7 @@ public:
AlgorithmIdentifier algorithm;
ByteBuffer raw_key;
};
ErrorOr<SubjectPublicKey> parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope = {});
class Certificate {
public: