summary refs log tree commit diff
path: root/crypto/src/tls/TlsCredentialedSigner.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-07-12 15:15:36 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-07-12 15:15:36 +0700
commit68c795fe81277f73aeb90d8ad4c6f4305f32c906 (patch)
tree59643344aafef91bbd4c4a3a7973deba3d837a00 /crypto/src/tls/TlsCredentialedSigner.cs
parentTLS test tweaks (diff)
downloadBouncyCastle.NET-ed25519-68c795fe81277f73aeb90d8ad4c6f4305f32c906.tar.xz
Port of new TLS API from bc-java
Diffstat (limited to 'crypto/src/tls/TlsCredentialedSigner.cs')
-rw-r--r--crypto/src/tls/TlsCredentialedSigner.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/src/tls/TlsCredentialedSigner.cs b/crypto/src/tls/TlsCredentialedSigner.cs
new file mode 100644
index 000000000..c6f5a8d7f
--- /dev/null
+++ b/crypto/src/tls/TlsCredentialedSigner.cs
@@ -0,0 +1,26 @@
+using System;
+using System.IO;
+
+using Org.BouncyCastle.Tls.Crypto;
+
+namespace Org.BouncyCastle.Tls
+{
+    /// <summary>Support interface for generating a signature based on our private credentials.</summary>
+    public interface TlsCredentialedSigner
+        : TlsCredentials
+    {
+        /// <summary>Generate a signature against the passed in hash.</summary>
+        /// <param name="hash">a message digest calculated across the message the signature is to apply to.</param>
+        /// <returns>an encoded signature.</returns>
+        /// <exception cref="IOException">if the hash cannot be processed, or there is an issue with the private
+        /// credentials.</exception>
+        byte[] GenerateRawSignature(byte[] hash);
+
+        /// <summary>Return the algorithm IDs for the signature algorithm and the associated hash it uses.</summary>
+        /// <returns>the full algorithm details for the signature.</returns>
+        SignatureAndHashAlgorithm SignatureAndHashAlgorithm { get; }
+
+        /// <exception cref="IOException"/>
+        TlsStreamSigner GetStreamSigner();
+    }
+}