diff options
Diffstat (limited to 'crypto/src/crypto/IAsymmetricBlockCipher.cs')
-rw-r--r-- | crypto/src/crypto/IAsymmetricBlockCipher.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crypto/src/crypto/IAsymmetricBlockCipher.cs b/crypto/src/crypto/IAsymmetricBlockCipher.cs new file mode 100644 index 000000000..455cfaa69 --- /dev/null +++ b/crypto/src/crypto/IAsymmetricBlockCipher.cs @@ -0,0 +1,30 @@ +using System; + +namespace Org.BouncyCastle.Crypto +{ + /// <remarks>Base interface for a public/private key block cipher.</remarks> + public interface IAsymmetricBlockCipher + { + /// <summary>The name of the algorithm this cipher implements.</summary> + string AlgorithmName { get; } + + /// <summary>Initialise the cipher.</summary> + /// <param name="forEncryption">Initialise for encryption if true, for decryption if false.</param> + /// <param name="parameters">The key or other data required by the cipher.</param> + void Init(bool forEncryption, ICipherParameters parameters); + + /// <returns>The maximum size, in bytes, an input block may be.</returns> + int GetInputBlockSize(); + + /// <returns>The maximum size, in bytes, an output block will be.</returns> + int GetOutputBlockSize(); + + /// <summary>Process a block.</summary> + /// <param name="inBuf">The input buffer.</param> + /// <param name="inOff">The offset into <paramref>inBuf</paramref> that the input block begins.</param> + /// <param name="inLen">The length of the input block.</param> + /// <exception cref="InvalidCipherTextException">Input decrypts improperly.</exception> + /// <exception cref="DataLengthException">Input is too large for the cipher.</exception> + byte[] ProcessBlock(byte[] inBuf, int inOff, int inLen); + } +} |