| // 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. | |
| // | |
| #ifndef THIRD_PARTY_CREDENTIO_CLAIM_MANIFEST_STORE_VIEW_H_ | |
| #define THIRD_PARTY_CREDENTIO_CLAIM_MANIFEST_STORE_VIEW_H_ | |
| #include <utility> | |
| #include "absl/status/statusor.h" | |
| #include "absl/strings/string_view.h" | |
| #include "cose/sig_structure.h" | |
| #include "jumbf/box.h" | |
| namespace credentio { | |
| class ClaimSignatureView { | |
| public: | |
| static absl::StatusOr<ClaimSignatureView> Create(jumbf::SuperBox superbox); | |
| absl::StatusOr<absl::string_view> GetPayload() const; | |
| absl::StatusOr<CoseSign1TaggedStructure> GetStruct() const; | |
| jumbf::SuperBox superbox() const { return superbox_; } | |
| private: | |
| explicit ClaimSignatureView(jumbf::SuperBox superbox) | |
| : superbox_(std::move(superbox)) {} | |
| jumbf::SuperBox superbox_; | |
| }; | |
| class ManifestView { | |
| public: | |
| static absl::StatusOr<ManifestView> Create(jumbf::SuperBox superbox); | |
| absl::StatusOr<ClaimSignatureView> GetClaimSignature() const; | |
| absl::string_view label() const; | |
| jumbf::SuperBox superbox() const { return superbox_; } | |
| private: | |
| explicit ManifestView(jumbf::SuperBox superbox) | |
| : superbox_(std::move(superbox)) {} | |
| jumbf::SuperBox superbox_; | |
| }; | |
| class ManifestStoreView { | |
| public: | |
| static absl::StatusOr<ManifestStoreView> Create( | |
| absl::string_view manifest_store); | |
| absl::StatusOr<ManifestView> GetActiveManifest() const; | |
| jumbf::SuperBox superbox() const { return superbox_; } | |
| private: | |
| explicit ManifestStoreView(jumbf::SuperBox superbox) : superbox_(superbox) {} | |
| jumbf::SuperBox superbox_; | |
| }; | |
| } // namespace credentio | |
| #endif // THIRD_PARTY_CREDENTIO_CLAIM_MANIFEST_STORE_VIEW_H_ |