blob: 5d164bd24bbe11f64655157380489d063010629e [file] [log] [blame]
Darin Petkov877642b2011-06-27 13:37:22 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_CRYPTO_INTERFACE_H_
6#define SHILL_CRYPTO_INTERFACE_H_
Darin Petkov877642b2011-06-27 13:37:22 -07007
8#include <string>
9
10namespace shill {
11
12// An interface to an encryption/decryption module.
13class CryptoInterface {
14 public:
15 virtual ~CryptoInterface() {}
16
17 // Returns a unique identifier for this crypto module.
18 virtual std::string GetID() = 0;
19
20 // Encrypts |plaintext| into |ciphertext|. Returns true on success.
21 virtual bool Encrypt(const std::string &plaintext,
22 std::string *ciphertext) = 0;
23
24 // Decrypts |ciphertext| into |plaintext|. Returns true on success.
25 virtual bool Decrypt(const std::string &ciphertext,
26 std::string *plaintext) = 0;
27};
28
29} // namespace shill
30
Ben Chanc45688b2014-07-02 23:50:45 -070031#endif // SHILL_CRYPTO_INTERFACE_H_