2 // RSAPKCS1SignatureDeformatter.cs - Handles PKCS#1 v.1.5 signature decryption.
5 // Sebastien Pouliot (spouliot@motus.com)
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
11 using Mono.Security.Cryptography;
13 namespace System.Security.Cryptography {
15 public class RSAPKCS1SignatureDeformatter : AsymmetricSignatureDeformatter {
18 private string hashName;
20 public RSAPKCS1SignatureDeformatter ()
25 public RSAPKCS1SignatureDeformatter (AsymmetricAlgorithm key)
30 public override void SetHashAlgorithm (string strName)
33 throw new ArgumentNullException ("strName");
37 public override void SetKey (AsymmetricAlgorithm key)
41 // here null is accepted with an ArgumentNullException!
44 public override bool VerifySignature (byte[] rgbHash, byte[] rgbSignature)
46 if ((rsa == null) || (hashName == null))
47 throw new CryptographicUnexpectedOperationException ();
48 if ((rgbHash == null) || (rgbSignature == null))
49 throw new ArgumentNullException ();
51 string oid = CryptoConfig.MapNameToOID (hashName);
52 return PKCS1.Verify_v15 (rsa, oid, rgbHash, rgbSignature);