Problem with exporting and importing AsymetricKey

Mar 19, 2015 at 2:40 PM
Edited Mar 20, 2015 at 3:01 PM
I'm trying to do something like this:
            var asymKey = WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm (AsymmetricAlgorithm.RsaOaepSha256).CreateKeyPair (2048);
            var exported = asymKey.Export ();
            foreach (var item in exported)
                System.Diagnostics.Debug.Write (item + " ");
            var imported = WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithm.RsaOaepSha256).ImportKeyPair(exported);
            foreach (var item in imported.Export ())
                System.Diagnostics.Debug.Write (item + " ");
I am getting different values from ICryptographicKey.KeySize before invoking Export and after invoking Import.
My project is Xamarin.Android min. API 15 target API 21

The problem occurs on: android v.4.0.3 and v5.0. On v.4.1.1 and 4.4.1 is OK.
Coordinator
Mar 23, 2015 at 3:44 AM
I take it you're the same author as https://github.com/AArnott/PCLCrypto/issues/15.
I consider this thread a dupe of that one.
Marked as answer by AArnott on 3/22/2015 at 8:44 PM