+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#include "abstractcryptobackend.h"
-
-abstract_crypto_backend::abstract_crypto_backend() {
-}
-
-abstract_crypto_backend::~abstract_crypto_backend() {
-}
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#ifndef ABSTRACTCRYPTOBACKEND_H_
-#define ABSTRACTCRYPTOBACKEND_H_
-
-#include <boost/noncopyable.hpp>
-#include <memory>
-#include <string>
-
-#include <device-certificate-manager-backend/dcm-backend-api.h>
-
-class abstract_crypto_backend_context;
-
-class abstract_crypto_backend : public std::enable_shared_from_this<abstract_crypto_backend>,
- public boost::noncopyable
-{
-protected:
- abstract_crypto_backend();
-
-public:
- virtual ~abstract_crypto_backend();
-};
-
-#endif /* ABSTRACTCRYPTOBACKEND_H_ */
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#include "abstractcryptobackendcontext.h"
-
-abstract_crypto_backend_context::abstract_crypto_backend_context() {
-}
-
-abstract_crypto_backend_context::~abstract_crypto_backend_context() {
-}
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#ifndef ABSTRACTCRYPTOBACKENDCONTEXT_H_
-#define ABSTRACTCRYPTOBACKENDCONTEXT_H_
-
-#include "abstractcryptobackend.h"
-
-class abstract_crypto_backend_context : public std::enable_shared_from_this<abstract_crypto_backend_context> {
-protected:
- abstract_crypto_backend_context();
-
-public:
- virtual ~abstract_crypto_backend_context();
-
- virtual int request_certificate_chain(std::string& mutable_chain) = 0;
-
- virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
- std::string& digestResult) = 0;
-
- virtual CryptoKeyType key_type() = 0;
-
- virtual unsigned int key_length() = 0;
-};
-
-#endif /* ABSTRACTCRYPTOBACKENDCONTEXT_H_ */
add_library(${DCM_BACKEND_API}
SHARED
dcm-backend-api-dummy.cpp
- ../abstractcryptobackend.cpp
- ../abstractcryptobackendcontext.cpp
- dummycryptobackend.cpp
dummycryptobackendcontext.cpp
../log.cpp
${CMAKE_CURRENT_BINARY_DIR}/rootCA_ecdsa_key.c
*
******************************************************************/
-#include "dummycryptobackend.h"
#include "dummycryptobackendcontext.h"
+#include <string>
+#include <device-certificate-manager-backend/dcm-backend-api.h>
void dcm_backend_create_key_context(dcm_backend_context& ctx,
const std::string& keyType) {
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#include "dummycryptobackend.h"
-#include "dummycryptobackendcontext.h"
-#include "log.h"
-
-dummy_crypto_backend::dummy_crypto_backend() {
-}
-
-dummy_crypto_backend::~dummy_crypto_backend() {
-}
+++ /dev/null
-/******************************************************************
- *
- * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
- *
- * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
- *
- * 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.
- *
- ******************************************************************/
-
-#ifndef DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_
-#define DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_
-
-#include "abstractcryptobackend.h"
-
-class dummy_crypto_backend final : public abstract_crypto_backend {
-public:
- dummy_crypto_backend();
- virtual ~dummy_crypto_backend();
-};
-
-#endif /* DUMMY_BACKEND_DUMMYCRYPTOBACKEND_H_ */
#include <mbedtls/ctr_drbg.h>
#include <iostream>
#include "log.h"
+#include <string>
extern "C" {
extern size_t dummy_rootca_rsa_key_size;
#ifndef DUMMY_BACKEND_DUMMYCRYPTOBACKENDCONTEXT_H_
#define DUMMY_BACKEND_DUMMYCRYPTOBACKENDCONTEXT_H_
-#include "abstractcryptobackendcontext.h"
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
+#include <string>
+#include <device-certificate-manager-backend/dcm-backend-api.h>
-class dummy_crypto_backend_context final : public abstract_crypto_backend_context {
+class dummy_crypto_backend_context {
public:
dummy_crypto_backend_context(const std::string& keyType);
- virtual ~dummy_crypto_backend_context();
+ ~dummy_crypto_backend_context();
- virtual int request_certificate_chain(std::string& mutable_chain) override;
+ int request_certificate_chain(std::string& mutable_chain);
- virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
- std::string& digestResult) override;
+ int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
+ std::string& digestResult);
- virtual CryptoKeyType key_type() override;
+ CryptoKeyType key_type();
- virtual unsigned int key_length() override;
+ unsigned int key_length();
private:
CryptoKeyType fKey;
SHARED
dcm-backend-api-kse.cpp
soresolver.cpp
- ../abstractcryptobackend.cpp
- ../abstractcryptobackendcontext.cpp
ksebackend.cpp
ksebackendcontext.cpp
../log.cpp
#include "ksebackend.h"
#include "ksebackendcontext.h"
+#include <device-certificate-manager-backend/dcm-backend-api.h>
static std::shared_ptr<kse_backend> backend(new kse_backend());
#ifndef KSE_BACKEND_KSEBACKEND_H_
#define KSE_BACKEND_KSEBACKEND_H_
-#include "abstractcryptobackend.h"
#include "soresolver.h"
#include <mutex>
-class kse_backend: public abstract_crypto_backend
+class kse_backend
{
public:
kse_backend();
- virtual ~kse_backend();
+ ~kse_backend();
inline so_resolver& get_so_resolver() {
return fSoResolver;
#ifndef KSE_BACKEND_KSEBACKENDCONTEXT_H_
#define KSE_BACKEND_KSEBACKENDCONTEXT_H_
-#include "abstractcryptobackendcontext.h"
#include "ksebackend.h"
+#include <device-certificate-manager-backend/dcm-backend-api.h>
-class kse_backend_context final : public abstract_crypto_backend_context {
+class kse_backend_context
+{
public:
kse_backend_context(std::shared_ptr<kse_backend> backend, const std::string& keyType);
- virtual ~kse_backend_context();
+ ~kse_backend_context();
- virtual int request_certificate_chain(std::string& mutable_chain) override;
+ int request_certificate_chain(std::string& mutable_chain);
- virtual int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
- std::string& digestResult) override;
+ int sign_crypto_data(MessageDigestType digestType, const std::string& dataToSign,
+ std::string& digestResult);
- virtual CryptoKeyType key_type() override;
+ CryptoKeyType key_type();
- virtual unsigned int key_length() override;
+ unsigned int key_length();
private:
int get_certificate(unsigned int index, std::string& cert);
#include "soresolver.h"
#include "log.h"
#include <dlfcn.h>
+#include <memory>
so_resolver::so_resolver(const std::string& libraryName) :
fLibraryName(libraryName),