Throw security exception if public key is not set for encrypt util