Rewrite key management & signing

Extend compos_helper to support signing, use it from CompOS.

Expose the public key from the VM. Rename compos_verify_key to
compos_verify and get it to verify the signature against the current
instance's public key.

Also move DICE access to compos_key_main. There's no use having it in
the library - neither the tests nor compos_verify can use it - and it
complicates the build rules.

There's a lot more that can be deleted, but I'll do that in a
follow-up; this is big enough already.

Bug: 218494522
Test: atest CompOsSigningHostTest CompOsDenialHostTest
Change-Id: I2d71f68a595d5ddadb2e7b16937fa6855f5db0ab
diff --git a/compos/compos_key_helper/Android.bp b/compos/compos_key_helper/Android.bp
index c53d88d..a932b40 100644
--- a/compos/compos_key_helper/Android.bp
+++ b/compos/compos_key_helper/Android.bp
@@ -8,7 +8,6 @@
 
     shared_libs: [
         "libbase",
-        "libbinder_ndk",
         "libcrypto",
     ],
 }
@@ -17,11 +16,7 @@
     name: "libcompos_key",
     defaults: ["compos_key_defaults"],
     srcs: ["compos_key.cpp"],
-
-    shared_libs: [
-        "android.hardware.security.dice-V1-ndk",
-        "android.security.dice-ndk",
-    ],
+    export_include_dirs: ["."],
 }
 
 cc_binary {
@@ -31,7 +26,9 @@
 
     static_libs: ["libcompos_key"],
     shared_libs: [
+        "android.hardware.security.dice-V1-ndk",
         "android.security.dice-ndk",
+        "libbinder_ndk",
     ],
 }