RDK Documentation (Open Sourced RDK Components)
secClientMocks.cpp
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #include "secClientMocks.h"
21 
22 AampMockSecClient *g_mockSecClient;
23 
24 int32_t SecClient_AcquireLicense(const char *serviceHostUrl,
25  uint8_t numberOfRequestMetadataKeys,
26  const char *requestMetadata[][2],
27  uint8_t numberOfAccessAttributes,
28  const char *accessAttributes[][2],
29  const char *contentMetadata,
30  size_t contentMetadataLength,
31  const char *licenseRequest,
32  size_t licenseRequestLength,
33  const char *keySystemId,
34  const char *mediaUsage,
35  const char *accessToken,
36  char **licenseResponse,
37  size_t *licenseResponseLength,
38  uint32_t *refreshDurationSeconds,
39  SecClient_ExtendedStatus *statusInfo)
40 {
41  /* Note that statusInfo is not passed due to mock limitations. */
42  return g_mockSecClient->SecClient_AcquireLicense(serviceHostUrl,
43  numberOfRequestMetadataKeys,
44  requestMetadata,
45  numberOfAccessAttributes,
46  accessAttributes,
47  contentMetadata,
48  contentMetadataLength,
49  licenseRequest,
50  licenseRequestLength,
51  keySystemId,
52  mediaUsage,
53  accessToken,
54  licenseResponse,
55  licenseResponseLength,
56  refreshDurationSeconds);
57 }
58 
59 int32_t SecClient_FreeResource(const char *resource)
60 {
61  return g_mockSecClient->SecClient_FreeResource(resource);
62 }
AampMockSecClient
Definition: secClientMocks.h:29