1 // Copyright 2016 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef KEYSTORE_INCLUDE_KEYSTORE_KEYATTESTATIONAPPLICATIONID_H_ 16 #define KEYSTORE_INCLUDE_KEYSTORE_KEYATTESTATIONAPPLICATIONID_H_ 17 18 #include "KeyAttestationPackageInfo.h" 19 #include "utils.h" 20 #include <binder/Parcelable.h> 21 #include <memory> 22 #include <vector> 23 24 namespace android { 25 namespace security { 26 namespace keymaster { 27 28 class KeyAttestationApplicationId : public Parcelable { 29 public: 30 typedef SharedNullableIterator<const KeyAttestationPackageInfo, std::vector> 31 ConstKeyAttestationPackageInfoIterator; 32 33 status_t writeToParcel(Parcel*) const override; 34 status_t readFromParcel(const Parcel* parcel) override; 35 36 ConstKeyAttestationPackageInfoIterator pinfos_begin() const { 37 return ConstKeyAttestationPackageInfoIterator(packageInfos_); 38 } 39 ConstKeyAttestationPackageInfoIterator pinfos_end() const { 40 return ConstKeyAttestationPackageInfoIterator(); 41 } 42 43 private: 44 std::shared_ptr<std::vector<std::unique_ptr<KeyAttestationPackageInfo>>> packageInfos_; 45 }; 46 47 } // namespace keymaster 48 } // namespace security 49 } // namsepace android 50 51 #endif // KEYSTORE_INCLUDE_KEYSTORE_KEYATTESTATIONAPPLICATIONID_H_ 52