equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
49 UNSIGNED_JARFILE, FIRST_FILE)); |
49 UNSIGNED_JARFILE, FIRST_FILE)); |
50 Utils.createFiles(FIRST_FILE, SECOND_FILE); |
50 Utils.createFiles(FIRST_FILE, SECOND_FILE); |
51 JarUtils.createJar(UNSIGNED_JARFILE, FIRST_FILE); |
51 JarUtils.createJar(UNSIGNED_JARFILE, FIRST_FILE); |
52 |
52 |
53 // create key pair for signing |
53 // create key pair for signing |
54 keytool( |
54 createAlias(CA_KEY_ALIAS); |
55 "-genkey", |
55 createAlias(KEY_ALIAS); |
56 "-alias", KEY_ALIAS, |
56 issueCert( |
57 "-keyalg", KEY_ALG, |
57 KEY_ALIAS, |
58 "-keysize", Integer.toString(KEY_SIZE), |
58 "-validity", Integer.toString(VALIDITY)); |
59 "-keystore", KEYSTORE, |
|
60 "-storepass", PASSWORD, |
|
61 "-keypass", PASSWORD, |
|
62 "-dname", "CN=Test", |
|
63 "-validity", Integer.toString(VALIDITY)).shouldHaveExitValue(0); |
|
64 |
59 |
65 // sign jar |
60 // sign jar |
66 OutputAnalyzer analyzer = jarsigner( |
61 OutputAnalyzer analyzer = jarsigner( |
67 "-verbose", |
62 "-verbose", |
68 "-keystore", KEYSTORE, |
63 "-keystore", KEYSTORE, |