| # Copyright 2026 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. |
| # |
| |
| load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| load("@rules_cc//cc:cc_test.bzl", "cc_test") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| cc_library( |
| name = "hasher", |
| srcs = ["hasher.cc"], |
| hdrs = ["hasher.h"], |
| deps = [ |
| "//crypto:algorithms", |
| "//crypto:hash", |
| "@abseil-cpp//absl/base:no_destructor", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/log:absl_log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@boringssl//:crypto", |
| ], |
| ) |
| |
| cc_test( |
| name = "hasher_test", |
| srcs = ["hasher_test.cc"], |
| deps = [ |
| ":hasher", |
| "//crypto:algorithms", |
| "//crypto:hash", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "eku_verifier", |
| srcs = ["eku_verifier.cc"], |
| hdrs = ["eku_verifier.h"], |
| deps = [ |
| "@abseil-cpp//absl/strings:string_view", |
| "@boringssl//:crypto", |
| ], |
| ) |
| |
| cc_test( |
| name = "eku_verifier_test", |
| srcs = ["eku_verifier_test.cc"], |
| deps = [ |
| ":eku_verifier", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "compliance_checker", |
| srcs = ["compliance_checker.cc"], |
| hdrs = ["compliance_checker.h"], |
| deps = [ |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:str_format", |
| "@boringssl//:crypto", |
| ], |
| ) |
| |
| cc_test( |
| name = "compliance_checker_test", |
| srcs = ["compliance_checker_test.cc"], |
| deps = [ |
| ":compliance_checker", |
| "//testing:crypto_testing", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@boringssl//:crypto", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "x509_certificate", |
| srcs = ["x509_certificate.cc"], |
| hdrs = ["x509_certificate.h"], |
| deps = [ |
| ":compliance_checker", |
| "//crypto:algorithms", |
| "@abseil-cpp//absl/base:no_destructor", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@boringssl//:crypto", |
| "@tink_cc//proto:common_cc_proto", |
| "@tink_cc//tink:cleartext_keyset_handle", |
| "@tink_cc//tink:public_key_verify", |
| "@tink_cc//tink/signature:config_v0", |
| "@tink_cc//tink/signature:signature_pem_keyset_reader", |
| ], |
| ) |
| |
| cc_test( |
| name = "x509_certificate_test", |
| srcs = ["x509_certificate_test.cc"], |
| deps = [ |
| ":x509_certificate", |
| "//crypto:algorithms", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@boringssl//:crypto", |
| "@googletest//:gtest_main", |
| "@tink_cc//proto:common_cc_proto", |
| "@tink_cc//tink/signature:signature_pem_keyset_reader", |
| ], |
| ) |
| |
| cc_library( |
| name = "pem", |
| srcs = ["pem.cc"], |
| hdrs = ["pem.h"], |
| deps = [ |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings:string_view", |
| "@boringssl//:crypto", |
| ], |
| ) |
| |
| cc_test( |
| name = "pem_test", |
| srcs = ["pem_test.cc"], |
| deps = [ |
| ":pem", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "trust_store", |
| srcs = ["trust_store.cc"], |
| hdrs = ["trust_store.h"], |
| deps = [ |
| ":pem", |
| "//proto:signature_info_cc_proto", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@boringssl//:pki", |
| "@protobuf//:timestamp_cc_proto", |
| ], |
| ) |
| |
| cc_library( |
| name = "timestamp_verifier", |
| srcs = ["timestamp_verifier.cc"], |
| hdrs = ["timestamp_verifier.h"], |
| deps = [ |
| ":hasher", |
| "//crypto:algorithms", |
| "//crypto:hash", |
| "//tsp:parsed_timestamp_token", |
| "//tsp:timestamp_parsing", |
| "//tsp:verified_timestamp", |
| "@abseil-cpp//absl/base:core_headers", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log:absl_log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/types:span", |
| "@boringssl//:crypto", |
| "@boringssl//:pki", |
| ], |
| ) |
| |
| cc_test( |
| name = "trust_store_test", |
| srcs = ["trust_store_test.cc"], |
| data = ["//testing/testdata/keys"], |
| deps = [ |
| ":trust_store", |
| "//testing:test_file_utils", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_test( |
| name = "timestamp_verifier_test", |
| srcs = ["timestamp_verifier_test.cc"], |
| deps = [ |
| ":timestamp_verifier", |
| ":trust_store", |
| "//crypto:algorithms", |
| "//crypto:cbs_utils", |
| "//proto:validation_result_cc_proto", |
| "//tsp:constants", |
| "//tsp:parsed_timestamp_token", |
| "//tsp:test_helpers", |
| "//tsp:verified_timestamp", |
| "@abseil-cpp//absl/algorithm:container", |
| "@abseil-cpp//absl/base:no_destructor", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/types:span", |
| "@boringssl//:crypto", |
| "@boringssl//:pki", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "default_crypto_read_handler", |
| srcs = ["default_crypto_read_handler.cc"], |
| hdrs = ["default_crypto_read_handler.h"], |
| deps = [ |
| ":eku_verifier", |
| ":trust_store", |
| ":x509_certificate", |
| "//cose:simple_cms_parser", |
| "//crypto:algorithms", |
| "//crypto:crypto_read_handler", |
| "//tsp:timestamp_verifier", |
| "//tsp:verified_timestamp", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/log:absl_check", |
| "@abseil-cpp//absl/log:absl_log", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/types:span", |
| "@boringssl//:crypto", |
| "@boringssl//:pki", |
| ], |
| ) |