1*789431f2SAndroid Build Coastguard Worker /* 2*789431f2SAndroid Build Coastguard Worker * Copyright 2020, The Android Open Source Project 3*789431f2SAndroid Build Coastguard Worker * 4*789431f2SAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*789431f2SAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*789431f2SAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*789431f2SAndroid Build Coastguard Worker * 8*789431f2SAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*789431f2SAndroid Build Coastguard Worker * 10*789431f2SAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*789431f2SAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*789431f2SAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*789431f2SAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*789431f2SAndroid Build Coastguard Worker * limitations under the License. 15*789431f2SAndroid Build Coastguard Worker */ 16*789431f2SAndroid Build Coastguard Worker 17*789431f2SAndroid Build Coastguard Worker #pragma once 18*789431f2SAndroid Build Coastguard Worker 19*789431f2SAndroid Build Coastguard Worker #include "AndroidKeyMintDevice.h" 20*789431f2SAndroid Build Coastguard Worker #include <aidl/android/hardware/security/sharedsecret/BnSharedSecret.h> 21*789431f2SAndroid Build Coastguard Worker #include <aidl/android/hardware/security/sharedsecret/SharedSecretParameters.h> 22*789431f2SAndroid Build Coastguard Worker 23*789431f2SAndroid Build Coastguard Worker namespace keymaster { 24*789431f2SAndroid Build Coastguard Worker class AndroidKeymaster; 25*789431f2SAndroid Build Coastguard Worker } 26*789431f2SAndroid Build Coastguard Worker namespace aidl::android::hardware::security::sharedsecret { 27*789431f2SAndroid Build Coastguard Worker using ::ndk::ScopedAStatus; 28*789431f2SAndroid Build Coastguard Worker using std::shared_ptr; 29*789431f2SAndroid Build Coastguard Worker using std::vector; 30*789431f2SAndroid Build Coastguard Worker 31*789431f2SAndroid Build Coastguard Worker class AndroidSharedSecret : public BnSharedSecret { 32*789431f2SAndroid Build Coastguard Worker public: 33*789431f2SAndroid Build Coastguard Worker explicit AndroidSharedSecret(const std::shared_ptr<keymint::AndroidKeyMintDevice>& keymint); 34*789431f2SAndroid Build Coastguard Worker virtual ~AndroidSharedSecret(); 35*789431f2SAndroid Build Coastguard Worker ScopedAStatus getSharedSecretParameters(SharedSecretParameters* params) override; 36*789431f2SAndroid Build Coastguard Worker ScopedAStatus computeSharedSecret(const vector<SharedSecretParameters>& params, 37*789431f2SAndroid Build Coastguard Worker vector<uint8_t>* sharingCheck) override; 38*789431f2SAndroid Build Coastguard Worker 39*789431f2SAndroid Build Coastguard Worker private: 40*789431f2SAndroid Build Coastguard Worker shared_ptr<::keymaster::AndroidKeymaster>& impl_; 41*789431f2SAndroid Build Coastguard Worker }; 42*789431f2SAndroid Build Coastguard Worker } // namespace aidl::android::hardware::security::sharedsecret 43