blob: 3aef6188c698b33808e7598b7e378e103551e539 [file] [log] [blame]
David Zeuthenab3e5652019-10-28 13:32:48 -04001/*
2 * Copyright (c) 2019, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SYSTEM_SECURITY_CREDENTIAL_STORE_FACTORY_H_
18#define SYSTEM_SECURITY_CREDENTIAL_STORE_FACTORY_H_
19
20#include <android/security/identity/BnCredentialStoreFactory.h>
21
22#include "CredentialStore.h"
23
24namespace android {
25namespace security {
26namespace identity {
27
28using ::android::sp;
29using ::android::binder::Status;
30using ::std::string;
31
32class CredentialStoreFactory : public BnCredentialStoreFactory {
33 public:
34 explicit CredentialStoreFactory(const string& dataPath);
35 ~CredentialStoreFactory();
36
37 Status getCredentialStore(int32_t credentialStoreType,
38 sp<ICredentialStore>* _aidl_return) override;
39
40 private:
41 CredentialStore* createCredentialStore(const string& serviceName);
42
43 string dataPath_;
44
45 sp<CredentialStore> defaultStore_;
46 sp<CredentialStore> directAccessStore_;
47};
48
49} // namespace identity
50} // namespace security
51} // namespace android
52
53#endif // SYSTEM_SECURITY_CREDENTIAL_STORE_FACTORY_H_