Skip to content

Commit

Permalink
Extract interfaces from CryptographyContext and SecureMimeContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Jan 12, 2024
1 parent d06bce0 commit 85fe75e
Show file tree
Hide file tree
Showing 4 changed files with 1,151 additions and 7 deletions.
12 changes: 6 additions & 6 deletions MimeKit/Cryptography/CryptographyContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace MimeKit.Cryptography {
/// directly, but rather via higher level APIs such as <see cref="MultipartSigned"/>,
/// <see cref="MultipartEncrypted"/> and <see cref="ApplicationPkcs7Mime"/>.
/// </remarks>
public abstract class CryptographyContext : IDisposable
public abstract class CryptographyContext : ICryptographyContext
{
const string SubclassAndRegisterFormat = "You need to subclass {0} and then register it with MimeKit.Cryptography.CryptographyContext.Register().";
static Func<SecureMimeContext> SecureMimeContextFactory;
Expand Down Expand Up @@ -78,12 +78,12 @@ protected CryptographyContext ()
}

/// <summary>
/// Get or set whether <see cref="MimeEntity"/>s should be prepared before signing.
/// Get or set whether a <see cref="MimeEntity"/> should be prepared before signing.
/// </summary>
/// <remarks>
/// Gets or sets whether <see cref="MimeEntity"/>s should be prepared before signing.
/// Gets or sets whether a <see cref="MimeEntity"/> should be prepared before signing.
/// </remarks>
/// <value><c>true</c> if MimeEntities should be prepared before signing; otherwise, <c>false</c>.</value>
/// <value><c>true</c> if a MimeEntity should be prepared before signing; otherwise, <c>false</c>.</value>
public bool PrepareBeforeSigning {
get; set;
}
Expand Down Expand Up @@ -802,7 +802,7 @@ public static void Register (Type type)
/// <exception cref="System.ArgumentNullException">
/// <paramref name="factory"/> is <c>null</c>.
/// </exception>
public static void Register (Func<SecureMimeContext> factory)
public static void Register (Func<SecureMimeContext> factory)
{
if (factory == null)
throw new ArgumentNullException (nameof (factory));
Expand All @@ -825,7 +825,7 @@ public static void Register (Func<SecureMimeContext> factory)
public static void Register (Func<OpenPgpContext> factory)
{
if (factory == null)
throw new ArgumentNullException(nameof (factory));
throw new ArgumentNullException (nameof (factory));

lock (mutex) {
PgpContextFactory = factory;
Expand Down
Loading

0 comments on commit 85fe75e

Please sign in to comment.