summary refs log tree commit diff
path: root/crypto/src/security/SignerUtilities.cs
diff options
context:
space:
mode:
authorJeffrey Stedfast <jeff@xamarin.com>2015-03-14 09:21:16 -0400
committerJeffrey Stedfast <jeff@xamarin.com>2015-03-14 09:21:16 -0400
commit5f446e15a61331939d37d0a62c72384e19b8a806 (patch)
tree6685f0f70604121f59b258d62e3efa63256053a6 /crypto/src/security/SignerUtilities.cs
parentMerge branch 'master' into vs2010 (diff)
parentUpdate TLS for draft-ietf-tls-session-hash-04 (diff)
downloadBouncyCastle.NET-ed25519-5f446e15a61331939d37d0a62c72384e19b8a806.tar.xz
Merge branch 'master' into vs2010
Diffstat (limited to 'crypto/src/security/SignerUtilities.cs')
-rw-r--r--crypto/src/security/SignerUtilities.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/src/security/SignerUtilities.cs b/crypto/src/security/SignerUtilities.cs

index c1aea50d6..bd1515147 100644 --- a/crypto/src/security/SignerUtilities.cs +++ b/crypto/src/security/SignerUtilities.cs
@@ -534,6 +534,26 @@ namespace Org.BouncyCastle.Security return new Iso9796d2Signer(new RsaBlindedEngine(), new RipeMD160Digest(), true); } + if (mechanism.EndsWith("/X9.31")) + { + string x931 = mechanism.Substring(0, mechanism.Length - "/X9.31".Length); + int withPos = x931.IndexOf("WITH"); + if (withPos > 0) + { + int endPos = withPos + "WITH".Length; + + string digestName = x931.Substring(0, withPos); + IDigest digest = DigestUtilities.GetDigest(digestName); + + string cipherName = x931.Substring(endPos, x931.Length - endPos); + if (cipherName.Equals("RSA")) + { + IAsymmetricBlockCipher cipher = new RsaBlindedEngine(); + return new X931Signer(cipher, digest); + } + } + } + throw new SecurityUtilityException("Signer " + algorithm + " not recognised."); }