Getting error : The saml2assertion cannot specify externalencryptedkeys unless encryptingcredentials are also specified

Hi I have configured my application to support encrypted assertion like below.

Once token comes in code in validation I am able to get decryption key successfully after then when I use write token to get decrypted token i am getting above error. I saw in detail i am getting values in encryptioncredential as well count of encryption key is >0 why both are coming. According to error ideally only encryption credential should come. Can someone please help me with the same. Its urgent.