Added support for testing. Fixed bugs in RsaAesControllerTrait