chromium/third_party/anonymous_tokens/src/anonymous_tokens/cpp/crypto/rsa_blind_signer.cc

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "anonymous_tokens/cpp/crypto/rsa_blind_signer.h"

#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <utility>

#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "anonymous_tokens/cpp/crypto/anonymous_tokens_pb_openssl_converters.h"
#include "anonymous_tokens/cpp/crypto/constants.h"
#include "anonymous_tokens/cpp/crypto/crypto_utils.h"
#include "anonymous_tokens/cpp/shared/status_utils.h"
#include "anonymous_tokens/proto/anonymous_tokens.pb.h"
#include <openssl/rsa.h>

namespace anonymous_tokens {
namespace {

absl::StatusOr<bssl::UniquePtr<RSA>> CreatePrivateKeyWithPublicMetadata(
    const absl::string_view rsa_modulus_str,
    const absl::string_view rsa_public_exponent_str,
    const absl::string_view rsa_p_str, const absl::string_view rsa_q_str,
    const absl::string_view rsa_crt_str,
    const absl::string_view public_metadata,
    const bool use_rsa_public_exponent) {}

}  // namespace

RsaBlindSigner::RsaBlindSigner(std::optional<absl::string_view> public_metadata,
                               bssl::UniquePtr<RSA> rsa_private_key)
    :{}

absl::StatusOr<std::unique_ptr<RsaBlindSigner>> RsaBlindSigner::New(
    const RSAPrivateKey& signing_key, const bool use_rsa_public_exponent,
    std::optional<absl::string_view> public_metadata) {}

absl::StatusOr<std::string> RsaBlindSigner::Sign(
    const absl::string_view blinded_data) const {}

}  // namespace anonymous_tokens