Forum Discussion
Gateway public key size problem
We are also seeing the same problem
Were you able to find out more, or has there been an official response?
Thanks
Incidently,
If you fix the provided code to use an encrypted length based on the key size, Power BI gateway won't decrypt and throws the following error:
DM.EnterpriseGateway Error: 0 : 2019-12-27T10:48:00.1390752Z DM.EnterpriseGateway a2650f49-396e-4e2c-b148-2cffef33b894 2880da58-6746-4578-83c6-40a997897f6a MGEC 00000000-0000-0000-0000-000000000000 d4c561e9-1c83-458a-84ed-1d5130e1dded d4c561e9-1c83-458a-84ed-1d5130e1dded 4B80A52E [DM.Pipeline.Common] Non-gateway exception encountered in activity scope: System.Security.Cryptography.CryptographicException: The parameter is incorrect.
at System.Security.Cryptography.NCryptNative.DecryptData[T](SafeNCryptKeyHandle key, Byte[] data, T& paddingInfo, AsymmetricPaddingMode paddingMode, NCryptDecryptor`1 decryptor)
at System.Security.Cryptography.NCryptNative.DecryptDataOaep(SafeNCryptKeyHandle key, Byte[] data, String hashAlgorithm)
at System.Security.Cryptography.RSACng.Decrypt(Byte[] data, RSAEncryptionPadding padding)
at Microsoft.PowerBI.DataMovement.CommonUtilities.Security.AsymmetricHigherKeyEncryptionHelper.Decrypt(String cipherText, String containerName)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.EncryptCredentialsWithSymmetricKey(GatewaySerializationContext responseContext, Func`1 getPlainCredentials)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.<>c__DisplayClass6_0.<<EncryptCredentialsWithTestDataSourceConnection>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayPipelineTelemetry.PipelineTelemetryService.<ExecuteInActivity>d__7`1.MoveNext()