From 549ee790d3e52bc62565ddf92e6a556e98b5195e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 15 Jul 2022 00:53:48 +0530 Subject: all: re-do package structure yet again --- .../dev/msfjarvis/aps/crypto/CryptoHandler.kt | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/CryptoHandler.kt (limited to 'crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/CryptoHandler.kt') diff --git a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/CryptoHandler.kt b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/CryptoHandler.kt deleted file mode 100644 index e8e9f995..00000000 --- a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/CryptoHandler.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package dev.msfjarvis.aps.crypto - -import com.github.michaelbull.result.Result -import dev.msfjarvis.aps.crypto.errors.CryptoHandlerException -import java.io.InputStream -import java.io.OutputStream - -/** Generic interface to implement cryptographic operations on top of. */ -public interface CryptoHandler { - - /** - * Decrypt the given [ciphertextStream] using a [privateKey] and [passphrase], and writes the - * resultant plaintext to [outputStream]. The returned [Result] should be checked to ensure it is - * **not** an instance of [com.github.michaelbull.result.Err] before the contents of - * [outputStream] are used. - */ - public fun decrypt( - privateKey: Key, - passphrase: String, - ciphertextStream: InputStream, - outputStream: OutputStream, - ): Result - - /** - * Encrypt the given [plaintextStream] to the provided [keys], and writes the encrypted ciphertext - * to [outputStream]. The returned [Result] should be checked to ensure it is **not** an instance - * of [com.github.michaelbull.result.Err] before the contents of [outputStream] are used. - */ - public fun encrypt( - keys: List, - plaintextStream: InputStream, - outputStream: OutputStream, - ): Result - - /** Given a [fileName], return whether this instance can handle it. */ - public fun canHandle(fileName: String): Boolean -} -- cgit v1.2.3