diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-10-11 17:41:20 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-10-11 17:41:20 +0700 |
commit | 02d07a1f8bd57f4141ef1a1dc006e5f72c1116c5 (patch) | |
tree | fb5b664fda22c03a399d5185d0fe48336961fea7 /crypto/src/security/SignerUtilities.cs | |
parent | More PORTABLE fixes (diff) | |
download | BouncyCastle.NET-ed25519-02d07a1f8bd57f4141ef1a1dc006e5f72c1116c5.tar.xz |
Refactoring to support custom ISignatureFactory
- see https://github.com/bcgit/bc-csharp/issues/153
Diffstat (limited to '')
-rw-r--r-- | crypto/src/security/SignerUtilities.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/src/security/SignerUtilities.cs b/crypto/src/security/SignerUtilities.cs index a9045ae6e..6107bf878 100644 --- a/crypto/src/security/SignerUtilities.cs +++ b/crypto/src/security/SignerUtilities.cs @@ -602,5 +602,17 @@ namespace Org.BouncyCastle.Security { return (string) algorithms[oid.Id]; } + + public static ISigner InitSigner(DerObjectIdentifier algorithmOid, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random) + { + return InitSigner(algorithmOid.Id, forSigning, privateKey, random); + } + + public static ISigner InitSigner(string algorithm, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random) + { + ISigner signer = SignerUtilities.GetSigner(algorithm); + signer.Init(forSigning, ParameterUtilities.WithRandom(privateKey, random)); + return signer; + } } } |