/* * Copyright (c) 2020 ETH Zürich, Educational Development and Technology (LET) * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using System.IO; using System.Security.Cryptography.X509Certificates; namespace SafeExamBrowser.Configuration.Contracts.Cryptography { /// /// Encrypts and decrypts data with a certificate. /// public interface IPublicKeyEncryption { /// /// Attempts to decrypt the given data. The decrypted data stream and the certificate can only be considered valid if /// is returned! /// LoadStatus Decrypt(Stream data, out Stream decrypted, out X509Certificate2 certificate); /// /// Attempts to encrypt the given data. The encrypted data stream can only be considered valid if /// is returned. /// SaveStatus Encrypt(Stream data, X509Certificate2 certificate, out Stream encrypted); } }