Updated to sign and encrypt