mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-17 15:02:24 +00:00
LibTLS: Export parse_subject_public_key_info
LibWeb wants to call this for Web Crypto.
This commit is contained in:
parent
e422c93537
commit
7b27c1ce6c
Notes:
sideshowbarker
2024-07-17 07:43:44 +09:00
Author: https://github.com/ADKaster
Commit: 7b27c1ce6c
Pull-request: https://github.com/SerenityOS/serenity/pull/23596
Reviewed-by: https://github.com/alimpfard
2 changed files with 3 additions and 4 deletions
|
@ -349,7 +349,7 @@ static ErrorOr<Validity> parse_validity(Crypto::ASN1::Decoder& decoder, Vector<S
|
||||||
return validity;
|
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 {
|
// SubjectPublicKeyInfo ::= Sequence {
|
||||||
// algorithm AlgorithmIdentifier,
|
// 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));
|
String algo_oid = TRY(String::join("."sv, public_key.algorithm.identifier));
|
||||||
ERROR_WITH_SCOPE(TRY(String::formatted("Unhandled algorithm {}", algo_oid)));
|
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)
|
static ErrorOr<Crypto::ASN1::BitStringView> parse_unique_identifier(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <AK/Time.h>
|
#include <AK/Time.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <LibCore/ConfigFile.h>
|
#include <LibCore/ConfigFile.h>
|
||||||
|
#include <LibCrypto/ASN1/DER.h>
|
||||||
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
|
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
|
||||||
#include <LibCrypto/PK/RSA.h>
|
#include <LibCrypto/PK/RSA.h>
|
||||||
#include <LibTLS/Extensions.h>
|
#include <LibTLS/Extensions.h>
|
||||||
|
@ -244,6 +245,7 @@ public:
|
||||||
AlgorithmIdentifier algorithm;
|
AlgorithmIdentifier algorithm;
|
||||||
ByteBuffer raw_key;
|
ByteBuffer raw_key;
|
||||||
};
|
};
|
||||||
|
ErrorOr<SubjectPublicKey> parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope = {});
|
||||||
|
|
||||||
class Certificate {
|
class Certificate {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue