Cert utils for challenge-response login keys

Add a helper function that builds the ChallengeResponseKey object
based on the public key information in the specified certificate.

This will be used for challenge-response logins (a.k.a. smart card
login) as higher-level APIs will identify the user with the
certificate, while the lower-level APIs (such as the cryptohomed D-Bus
API) only deal with public keys and signature algorithms.

BUG=chromium:826417
TEST=chromeos_unittests --gtest_filter=ChallengeResponseCertUtilsTest*

Change-Id: Ie1ac1e9b13e44748f98aad4a0ac69df0e638e70f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1107058
Reviewed-by: Matt Mueller <mattm@chromium.org>
Reviewed-by: Jacob Dufault <jdufault@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654122}
4 files changed