summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2014-11-14 11:00:18 +0000
committerSami Tolvanen <samitolvanen@google.com>2014-11-14 11:00:18 +0000
commit40193d94182934b37f4b2ae00fde2402583e59e1 (patch)
treeb5144a352f0141808f1ce5c98190666bdfdc478f
parent3380f2fea1b9a18f26ae95b60a01eeb55565eb1b (diff)
downloadextras-40193d94182934b37f4b2ae00fde2402583e59e1.tar.gz
Fix comments in BootSignature.java.
Clearly mark the comment above main() as an example and fix the parameters in the example command. Also briefly document the arguments in the main function for clarity. Bug: 18376609 Change-Id: I84eaf75799a8128100eb97c70e04563c609e9928
-rw-r--r--verity/BootSignature.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/verity/BootSignature.java b/verity/BootSignature.java
index 3e23a1ec..c45224a7 100644
--- a/verity/BootSignature.java
+++ b/verity/BootSignature.java
@@ -265,22 +265,29 @@ public class BootSignature extends ASN1Object
System.exit(1);
}
- /* java -cp
- ../../../out/host/common/obj/JAVA_LIBRARIES/BootSignature_intermediates/\
- classes/com.android.verity.BootSignature \
- boot \
- ../../../out/target/product/flounder/boot.img \
- ../../../build/target/product/security/verity_private_dev_key \
- ../../../build/target/product/security/verity.pk8 \
- ../../../build/target/product/security/verity.x509.pem \
- /tmp/boot.img.signed
+ /* Example usage for signing a boot image using dev keys:
+ java -cp \
+ ../../../out/host/common/obj/JAVA_LIBRARIES/BootSignature_intermediates/ \
+ classes/com.android.verity.BootSignature \
+ /boot \
+ ../../../out/target/product/$PRODUCT/boot.img \
+ ../../../build/target/product/security/verity.pk8 \
+ ../../../build/target/product/security/verity.x509.pem \
+ /tmp/boot.img.signed
*/
public static void main(String[] args) throws Exception {
Security.addProvider(new BouncyCastleProvider());
if ("-verify".equals(args[0])) {
+ /* args[1] is the path to a signed boot image */
verifySignature(args[1]);
} else {
+ /* args[0] is the target name, typically /boot
+ args[1] is the path to a boot image to sign
+ args[2] is the path to a private key
+ args[3] is the path to the matching public key certificate
+ args[4] is the path where to output the signed boot image
+ */
doSignature(args[0], args[1], args[2], args[3], args[4]);
}
}