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. |
55 // calculate certificate expiration date |
55 // calculate certificate expiration date |
56 Date expirationDate = new Date(System.currentTimeMillis() + VALIDITY |
56 Date expirationDate = new Date(System.currentTimeMillis() + VALIDITY |
57 * 24 * 60 * 60 * 1000L); |
57 * 24 * 60 * 60 * 1000L); |
58 |
58 |
59 // create key pair |
59 // create key pair |
60 keytool( |
60 createAlias(CA_KEY_ALIAS); |
61 "-genkey", |
61 createAlias(KEY_ALIAS); |
62 "-alias", KEY_ALIAS, |
62 issueCert(KEY_ALIAS, |
63 "-keyalg", KEY_ALG, |
|
64 "-keysize", Integer.toString(KEY_SIZE), |
|
65 "-keystore", KEYSTORE, |
|
66 "-storepass", PASSWORD, |
|
67 "-keypass", PASSWORD, |
|
68 "-dname", "CN=Test", |
|
69 "-validity", Integer.toString(VALIDITY)); |
63 "-validity", Integer.toString(VALIDITY)); |
70 |
64 |
71 // sign jar file |
65 // sign jar file |
72 OutputAnalyzer analyzer = jarsigner( |
66 OutputAnalyzer analyzer = jarsigner( |
73 "-J-Duser.timezone=" + timezone, |
67 "-J-Duser.timezone=" + timezone, |