Error in case of encrypted SAML Assertion

Getting following error
the saml2assertion cannot specify externalencryptedkeys unless encryptingcredentials are also specified.

while enable assertion encryption in application. Can someone please guide me what configuration I wrong so that I am getting both external encryptionkey and encryption credential.

Thanks in afdvance.