update handling of secret keys