1 /*
2  * Copyright (C) 2018 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 CLEARKEY_CRYPTO_FACTORY_H_
18 #define CLEARKEY_CRYPTO_FACTORY_H_
19 
20 #include <android/hardware/drm/1.0/ICryptoPlugin.h>
21 #include <android/hardware/drm/1.2/ICryptoFactory.h>
22 
23 #include "ClearKeyTypes.h"
24 
25 namespace android {
26 namespace hardware {
27 namespace drm {
28 namespace V1_2 {
29 namespace clearkey {
30 
31 using ::android::hardware::drm::V1_2::ICryptoFactory;
32 using ::android::hardware::drm::V1_0::ICryptoPlugin;
33 using ::android::hardware::hidl_array;
34 using ::android::hardware::hidl_string;
35 using ::android::hardware::Return;
36 
37 struct CryptoFactory : public ICryptoFactory {
CryptoFactoryCryptoFactory38     CryptoFactory() {}
~CryptoFactoryCryptoFactory39     virtual ~CryptoFactory() {}
40 
41     Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
42             override;
43 
44     Return<void> createPlugin(
45             const hidl_array<uint8_t, 16>& uuid,
46             const hidl_vec<uint8_t>& initData,
47             createPlugin_cb _hidl_cb) override;
48 
49 private:
50     CLEARKEY_DISALLOW_COPY_AND_ASSIGN(CryptoFactory);
51 
52 };
53 
54 } // namespace clearkey
55 } // namespace V1_2
56 } // namespace drm
57 } // namespace hardware
58 } // namespace android
59 
60 #endif // CLEARKEY_CRYPTO_FACTORY_H_
61