title: WinRT CryptographicEngine::Encrypt/Decrypt throwing InvalidArgumentException
body: <p>So I've run into an interesting issue when trying to use the new cryptography namespace in WinRT (<code>Windows::Security::Cryptography</code>). Namely, when I try to use the <code>CryptographicEngine::Encrypt()</code> or <code>CryptographicEngine::Decrypt()</code> methods, they throw an <code>InvalidArgumentException</code>. I'm by no means a pro in this area, but I feel I've narrowed it down to a fairly basic scenario and am still getting the failure:</p>
  
  <pre><code>//------------------------------------------------------------------------------
  // TestEncryptDecrypt
  // Simple test that encrypts a string, then decrypts it and compares the result.
  void TestEncryptDecrypt()
  {
      // Select asymmetric algorithm
      Platform::String^ strAlgorithm = Windows::Security::Cryptography::Core::AsymmetricAlgorithmNames::RsaOaepSha512;
      Windows::Security::Cryptography::Core::AsymmetricKeyAlgorithmProvider^ spAlgorithm = Windows::Security::Cryptography::Core::AsymmetricKeyAlgorithmProvider::OpenAlgorithm(strAlgorithm);
  
      // Create public/private keys
      unsigned int nKeySize = 512;
      Windows::Security::Cryptography::Core::CryptographicKey^ spKeyPair = spAlgorithm-&gt;CreateKeyPair(nKeySize);
  
      // Message to encrypt/decrypt
      Platform::String^ strMessage = L"Test Message";
      Windows::Storage::Streams::IBuffer^ spMessageBuffer = Windows::Security::Cryptography::CryptographicBuffer::ConvertStringToBinary(strMessage, Windows::Security::Cryptography::BinaryStringEncoding::Utf8);
  
      // Encrypt the data
      // *** InvalidArgumentException throw here ***
      Windows::Storage::Streams::IBuffer^ spEncryptedBuffer = Windows::Security::Cryptography::Core::CryptographicEngine::Encrypt(spKeyPair, spMessageBuffer, nullptr /*Initialization vector not used with asymmetric algorithms.*/);
  
      // Decrypt the data
      Windows::Storage::Streams::IBuffer^ spUnencryptedBuffer = Windows::Security::Cryptography::Core::CryptographicEngine::Decrypt(spKeyPair, spEncryptedBuffer, nullptr /*Initialization vector not used with asymmetric algorithms.*/);
  
      // Retrieve the original message
      Platform::String^ strUnencryptedMessage = Windows::Security::Cryptography::CryptographicBuffer::ConvertBinaryToString(Windows::Security::Cryptography::BinaryStringEncoding::Utf8, spUnencryptedBuffer);
      Assert(strUnencryptedMessage == strMessage);
  }
  </code></pre>
  
  <p>I could still be doing something silly (and probably am), but unfortunately I'm not seeing it...  any ideas?</p>
  
  <p>Thanks in advance!  :)</p>