locked
A list of Windows.Security.Cryptography features unavailable in Metro apps

    Question

  • Hello,

    I'm playing with Windows.Security.Cryptography namespace (framework version: 4.5.1, a Metro/Windows Store revision) for last couple of days and I found out that a lot of methods within this namespace throw a System.NotImplementedException. Particularly, this exception is thrown by Windows.Security.Cryptography.Core.CryptographicEngine.VerifySignatureWithHashInput() and CryptographicKey.Export() and ExportPublicKey() methods.

    I wonder if there is any official list of methods that are not implemented in the Metro version of the framework available somewhere?

    Thanks in advance,

    Ken

    • Moved by Fred Bao Wednesday, October 01, 2014 2:47 AM Store app related
    Tuesday, September 30, 2014 11:22 AM

All replies

  • We don't have an official list. The list of things that are different between the Windows Store APIs and full set of .NET APIs is vast. 

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, October 01, 2014 1:21 PM
    Moderator
  • Thanks Matt,

    So, do I understand you right that there's no way to find out whether a particular method is or is not implemented in a Windows Store revision of the framework? MSDN reference does not provide any details on this, so we would probably need to do a lot of PoC checks before going ahead with our project.

    Thanks,

    Ken

    Wednesday, October 01, 2014 6:59 PM
  • I think I may have misread this post - are you saying that these methods throw "Not Implemented" at runtime?

    Windows.Security.Cryptography.Core.CryptographicEngine.VerifySignatureWithHashInput() 
    CryptographicKey.Export() 
    CryptographicKey.ExportPublicKey()

    That doesn't make sense - these are definitely implemented and should run.  Can you show code that shows how they throw the exception for you?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, October 01, 2014 7:48 PM
    Moderator
  • Hello, I'm facing this issue on Windows Phone 8.1.

    I just wrote this simple unit test:

            [TestMethod]
            public void TestCryptographicKey()
            {
                var prov = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbc);
    
                var key = prov.CreateSymmetricKey(CryptographicBuffer.GenerateRandom(64));
    
                var bytes = key.Export();
    
                Debug.WriteLine("Key: " + CryptographicBuffer.EncodeToHexString(bytes));
            }
    
    Export method throws System.NotImplementedException.
    Thursday, January 29, 2015 7:25 AM
  • Well, reading the documentation better, CryptographicKey.Export methods seem to be supported for key pairs only...
    Thursday, January 29, 2015 8:00 AM