static async Task <RSAParameters> GetRsa(int keyStrength, string keyIdentifier) { var blob = await ResourcesProvider.GetBytesAsync($"RSA_{keyStrength}_{keyIdentifier}.bin", ResourceType.RsaKeys); var rsaParams = BCryptRsaImport.BlobToParameters(blob, out int resultBitLength, out bool isPrivate); if (keyStrength != resultBitLength) { throw new InvalidDataException("Desired keyStrength does not match parsed data"); } return(rsaParams); }