- "recreated. This will be done automatically now.\n"
- "Your new key will expire in %d days from today.\n"
- "--------------------------------------------------\n",
- SILC_CLIENT_KEY_EXPIRES);
-
- silc_client_create_key_pair(SILC_CLIENT_DEF_PKCS,
- SILC_CLIENT_DEF_PKCS_LEN,
- file_public_key,
- file_private_key, identifier, NULL, NULL);
+ "recreated. Would you like to create a new key pair\n"
+ "now? If you answer Yes, the new key will expire in\n"
+ "%d days from today. If you answer No, the old key\n"
+ "will expire again in %d days from today.\n"
+ "----------------------------------------------------\n",
+ SILC_CLIENT_KEY_EXPIRES, SILC_CLIENT_KEY_EXPIRES);
+
+ answer = silc_get_input("Would you like to create a new key pair "
+ "([y]/n)?: ", FALSE);
+ if (!answer || answer[0] == 'Y' || answer[0] == 'y') {
+ silc_client_create_key_pair(SILC_CLIENT_DEF_PKCS,
+ SILC_CLIENT_DEF_PKCS_LEN,
+ file_public_key,
+ file_private_key, identifier, NULL, NULL);
+ } else {
+#ifdef HAVE_UTIME
+ struct utimbuf utim;
+ utim.actime = time(NULL);
+ utim.modtime = time(NULL);
+ utime(file_private_key, &utim);
+#endif
+ }
+ silc_free(answer);