summaryrefslogtreecommitdiff
path: root/src/manager/crypto/generic-backend/gstore.h
diff options
context:
space:
mode:
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>2015-05-04 14:31:27 +0200
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>2015-05-12 16:12:25 +0200
commitea43f2088832df7a4bdda3714bc595b14d46af2c (patch)
tree9c0ff7f67f8bd257ce5cb9008679878bd60bd12b /src/manager/crypto/generic-backend/gstore.h
parentd2ce48eb176a1f51a61102f510f67b5ccb957a7c (diff)
downloadkey-manager-ea43f2088832df7a4bdda3714bc595b14d46af2c.tar.gz
key-manager-ea43f2088832df7a4bdda3714bc595b14d46af2c.tar.bz2
key-manager-ea43f2088832df7a4bdda3714bc595b14d46af2c.zip
New class hierarchy (multiple backends support).
Current implemantion my use only one crypto library. The target is to use at least two libraries at the same time (openssl and trustzone library for arm devices). Change-Id: I3563fb1c89f3603a927b8b19f6358b4fc3f5c7cf
Diffstat (limited to 'src/manager/crypto/generic-backend/gstore.h')
-rw-r--r--src/manager/crypto/generic-backend/gstore.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/manager/crypto/generic-backend/gstore.h b/src/manager/crypto/generic-backend/gstore.h
new file mode 100644
index 00000000..a3c76fdb
--- /dev/null
+++ b/src/manager/crypto/generic-backend/gstore.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2000 - 2015 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 gstore.h
+ * @author Bartłomiej Grzelewski (b.grzelewski@samsung.com)
+ * @version 1.0
+ */
+#pragma once
+
+#include <memory>
+
+#include <generic-backend/exception.h>
+#include <generic-backend/gkey.h>
+#include <generic-backend/id.h>
+#include <generic-backend/token.h>
+#include <ckm/ckm-type.h>
+
+namespace CKM {
+namespace Crypto {
+
+class GStore {
+protected:
+ GStore(){}
+public:
+ virtual Id getBackendId() const { Throw(Exception::OperationNotSupported); }
+ virtual GKeyShPtr getKey(const Token &) { Throw(Exception::OperationNotSupported); }
+ virtual TokenPair generateAKey(const CryptoAlgorithm &) { Throw(Exception::OperationNotSupported); }
+ virtual Token generateSKey(const CryptoAlgorithm &) { Throw(Exception::OperationNotSupported); }
+ virtual Token import(KeyType, const RawBuffer &) { Throw(Exception::OperationNotSupported); }
+ virtual void destroy(const Token &) { Throw(Exception::OperationNotSupported); }
+ virtual ~GStore() {}
+};
+
+typedef std::shared_ptr<GStore> GStoreShPtr;
+
+} // namespace Crypto
+} // namespace CKM
+