This project is read-only.

Problem with exporting and importing AsymetricKey

Mar 19, 2015 at 3:40 PM
Edited Mar 20, 2015 at 4: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.
Mar 23, 2015 at 4:44 AM
I take it you're the same author as
I consider this thread a dupe of that one.
Marked as answer by AArnott on 3/22/2015 at 8:44 PM