#include <memory>
+#define TANCHOR_API __attribute__((visibility("default")))
+
+
namespace tanchor {
-class TrustAnchor {
+class TANCHOR_API TrustAnchor {
public:
explicit TrustAnchor(const std::string &packageId,
const std::string &certsDir,
ADD_LIBRARY(${TARGET_TANCHOR_LIB} SHARED ${${TARGET_TANCHOR_LIB}_SRCS})
-# TODO(sangwan.kwon) visibility needed to be hidden
SET_TARGET_PROPERTIES(${TARGET_TANCHOR_LIB}
- PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+ PROPERTIES COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden"
SOVERSION ${API_VERSION}
VERSION ${LIB_VERSION}
)
#include "tanchor/trust-anchor.h"
#include "tanchor/trust-anchor.hxx"
+#include "macros.hxx"
+
using namespace tanchor;
+TANCHOR_API
int trust_anchor_global_install(const char *package_id,
const char *app_certificates_path,
bool with_system_certificates)
return ta.install(with_system_certificates);
}
+TANCHOR_API
int trust_anchor_usr_install(const char *package_id,
const char *app_certificates_path,
uid_t uid,
return ta.install(with_system_certificates);
}
+TANCHOR_API
int trust_anchor_global_launch(const char *package_id,
const char *app_certificates_path,
bool with_system_certificates)
return ta.launch(with_system_certificates);
}
+TANCHOR_API
int trust_anchor_usr_launch(const char *package_id,
const char *app_certificates_path,
uid_t uid,
return ta.launch(with_system_certificates);
}
+TANCHOR_API
int trust_anchor_global_uninstall(const char *package_id,
const char *app_certificates_path)
{
return ta.uninstall();
}
+TANCHOR_API
int trust_anchor_usr_uninstall(const char *package_id,
const char *app_certificates_path,
uid_t uid)
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+/*
+ * @file macros.hxx
+ * @author Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version 0.1
+ * @brief Preprocessor macros
+ */
+#pragma once
+
+#ifndef TANCHOR_API
+#define TANCHOR_API __attribute__((visibility("default")))
+#endif
SET(INTERNAL_SRCS main.cpp
test-curl.cpp
test-util.cpp
- test-certificate.cpp)
+ test-certificate.cpp
+
+ ${TANCHOR_SRC}/certificate.cpp)
SET(TEST_INSTALLER ${TARGET_TANCHOR_TEST}-installer)
SET(TEST_LAUNCHER ${TARGET_TANCHOR_TEST}-launcher)