Asylo
sgx_identity_expectation_matcher.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 Asylo authors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef ASYLO_IDENTITY_PLATFORM_SGX_SGX_IDENTITY_EXPECTATION_MATCHER_H_
20 #define ASYLO_IDENTITY_PLATFORM_SGX_SGX_IDENTITY_EXPECTATION_MATCHER_H_
21 
22 #include <string>
23 
24 #include "asylo/identity/identity.pb.h"
25 #include "asylo/identity/named_identity_expectation_matcher.h"
26 #include "asylo/util/statusor.h"
27 
28 namespace asylo {
29 
30 /// `SgxIdentityExpectationMatcher` is capable of matching SGX identities with
31 /// SGX identity expectations.
32 class SgxIdentityExpectationMatcher final
33  : public NamedIdentityExpectationMatcher {
34  public:
37 
38  /// From the `IdentityExpectationMatcher` interface.
39  ///
40  /// \param identity An identity to match.
41  /// \param expectation The identity expectation to match against.
42  /// \param[out] explanation An explanation of why the match failed, if the
43  /// return value was false.
44  /// \return A bool indicating whether the match succeeded, or a non-OK Status
45  /// in the case of invalid arguments.
48  std::string *explanation) const override;
49 
50  /// From the `NamedIdentityExpectationMatcher` interface.
51  ///
52  /// \return A description of the enclave identities/enclave identity
53  /// expectations this matcher is able to match.
54  EnclaveIdentityDescription Description() const override;
55 };
56 
57 } // namespace asylo
58 
59 #endif // ASYLO_IDENTITY_PLATFORM_SGX_SGX_IDENTITY_EXPECTATION_MATCHER_H_
~SgxIdentityExpectationMatcher() override=default
ABSL_CONST_INIT const char kStatusMoveAssignmentMsg[]
StatusOr< bool > MatchAndExplain(const EnclaveIdentity &identity, const EnclaveIdentityExpectation &expectation, std::string *explanation) const override
From the IdentityExpectationMatcher interface.
EnclaveIdentityDescription Description() const override
From the NamedIdentityExpectationMatcher interface.