blob: 32197af25282a02cc4cea319d4617b3508bc684d [file] [log] [blame]
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
namespace shill {
// An interface to an encryption/decryption module.
class CryptoInterface {
virtual ~CryptoInterface() = default;
// Returns a unique identifier for this crypto module.
virtual std::string GetId() const = 0;
// Encrypts |plaintext| into |ciphertext|. Returns true on success.
virtual bool Encrypt(const std::string& plaintext,
std::string* ciphertext) = 0;
// Decrypts |ciphertext| into |plaintext|. Returns true on success.
virtual bool Decrypt(const std::string& ciphertext,
std::string* plaintext) = 0;
} // namespace shill