#include <stddef.h>
#include <stdint.h>
#include <string_view>
#include "base/base64url.h"
#include "base/containers/span.h"
#include "components/webcrypto/algorithm_dispatch.h"
#include "components/webcrypto/algorithms/test_helpers.h"
#include "components/webcrypto/jwk.h"
#include "components/webcrypto/status.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_crypto_algorithm_params.h"
#include "third_party/blink/public/platform/web_crypto_key_algorithm.h"
namespace webcrypto {
namespace {
blink::WebCryptoAlgorithm CreateRsaOaepAlgorithm(
const std::vector<uint8_t>& label) { … }
std::string Base64EncodeUrlSafe(const std::vector<uint8_t>& input) { … }
base::Value::Dict CreatePublicKeyJwkDict(
base::flat_map<std::string, std::string> extra_properties) { … }
class WebCryptoRsaOaepTest : public WebCryptoTestBase { … };
TEST_F(WebCryptoRsaOaepTest, ImportPkcs8WithRsaEncryption) { … }
TEST_F(WebCryptoRsaOaepTest, ImportPublicJwkWithNoAlg) { … }
TEST_F(WebCryptoRsaOaepTest, ImportPublicJwkWithMatchingAlg) { … }
TEST_F(WebCryptoRsaOaepTest, ImportPublicJwkWithMismatchedAlgFails) { … }
TEST_F(WebCryptoRsaOaepTest, ImportPublicJwkWithMismatchedTypeFails) { … }
TEST_F(WebCryptoRsaOaepTest, ExportPublicJwk) { … }
struct RsaOaepKnownAnswer { … };
const RsaOaepKnownAnswer kRsaOaepKnownAnswers[] = …;
TEST_F(WebCryptoRsaOaepTest, EncryptDecryptKnownAnswerTest) { … }
TEST_F(WebCryptoRsaOaepTest, EncryptWithLargeMessageFails) { … }
TEST_F(WebCryptoRsaOaepTest, EncryptWithLargeDigestFails) { … }
TEST_F(WebCryptoRsaOaepTest, DecryptWithLargeMessageFails) { … }
TEST_F(WebCryptoRsaOaepTest, WrapUnwrapRawKey) { … }
TEST_F(WebCryptoRsaOaepTest, WrapUnwrapJwkSymKey) { … }
TEST_F(WebCryptoRsaOaepTest, ImportExportJwkRsaPublicKey) { … }
}
}