2002-11-17 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / corlib / System.Security.Cryptography / RSAPKCS1SignatureFormatter.cs
index 89c60292438b5f69b65789f04898d69f5fa1ffde..200bcc5583d29241a852922f10c9dde1ae71943a 100644 (file)
@@ -26,26 +26,23 @@ public class RSAPKCS1SignatureFormatter : AsymmetricSignatureFormatter {
                SetKey (key);
        }
 
-       [MonoTODO()]
        public override byte[] CreateSignature (byte[] rgbHash) 
        {
                if ((rsa == null) || (hash == null))
                        throw new CryptographicUnexpectedOperationException ();
                if (rgbHash == null)
                        throw new ArgumentNullException ();
-               // TODO
-               return null;
+
+               string oid = CryptoConfig.MapNameToOID (hash.ToString ());
+               return PKCS1.Sign_v15 (rsa, oid, rgbHash);
        }
 
-       [MonoTODO()]
        public override byte[] CreateSignature (HashAlgorithm hash) 
        {
                if (hash == null)
                        throw new ArgumentNullException ();
-               if (rsa == null)
-                       throw new CryptographicUnexpectedOperationException ();
-               // TODO
-               return null;
+               this.hash = hash;
+               return CreateSignature (hash.Hash);
        }
 
        public override void SetHashAlgorithm (string strName)