Encryption service calls proper encryption/decryption methods
[platform/core/security/key-manager.git] / src / manager / crypto / generic-backend / gkey.h
index 8ad6eda..b06926d 100644 (file)
@@ -33,29 +33,30 @@ class GKey {
 protected:
     GKey(){}
 public:
 protected:
     GKey(){}
 public:
-    virtual RawBuffer getBinary() {
-        Throw(Exception::OperationNotSupported);
+    virtual RawBuffer getBinary() const {
+        ThrowErr(Exc::Crypto::OperationNotSupported);
     }
 
     virtual RawBuffer encrypt(const CryptoAlgorithm &, const RawBuffer &) {
     }
 
     virtual RawBuffer encrypt(const CryptoAlgorithm &, const RawBuffer &) {
-        Throw(Exception::OperationNotSupported);
+        ThrowErr(Exc::Crypto::OperationNotSupported);
     }
 
     virtual RawBuffer decrypt(const CryptoAlgorithm &, const RawBuffer &) {
     }
 
     virtual RawBuffer decrypt(const CryptoAlgorithm &, const RawBuffer &) {
-        Throw(Exception::OperationNotSupported);
+        ThrowErr(Exc::Crypto::OperationNotSupported);
     }
 
     virtual RawBuffer sign(const CryptoAlgorithm &, const RawBuffer &) {
     }
 
     virtual RawBuffer sign(const CryptoAlgorithm &, const RawBuffer &) {
-        Throw(Exception::OperationNotSupported);
+        ThrowErr(Exc::Crypto::OperationNotSupported);
     }
 
     virtual int verify(const CryptoAlgorithm &, const RawBuffer &, const RawBuffer &) {
     }
 
     virtual int verify(const CryptoAlgorithm &, const RawBuffer &, const RawBuffer &) {
-        Throw(Exception::OperationNotSupported);
+        ThrowErr(Exc::Crypto::OperationNotSupported);
     }
 
     virtual ~GKey () {}
 };
 
     }
 
     virtual ~GKey () {}
 };
 
+typedef std::unique_ptr<GKey> GKeyUPtr;
 typedef std::shared_ptr<GKey> GKeyShPtr;
 
 } // namespace Crypto
 typedef std::shared_ptr<GKey> GKeyShPtr;
 
 } // namespace Crypto