Key-handling infrastructure.