More work on api key caching/decryption.