Lines Matching defs:private

151 /* Format for writing private keys */
154 /* Cipher for new-format private keys */
648 do_convert_from_ssh2(struct passwd *pw, struct sshkey **k, int *private)
668 *private = 1;
690 if (*private) {
692 fatal_f("private key conversion failed");
700 do_convert_from_pkcs8(struct sshkey **k, int *private)
746 do_convert_from_pem(struct sshkey **k, int *private)
765 fatal_f("unrecognised raw private key format");
772 int r, private = 0, ok = 0;
782 do_convert_from_ssh2(pw, &k, &private);
785 do_convert_from_pkcs8(&k, &private);
788 do_convert_from_pem(&k, &private);
794 if (!private) {
955 debug_r(r, "load private \"%s\"", path);
997 * Input may be plain keys, private keys, authorized_keys
1002 * Try private keys first. Assume a key is private if
1004 * not reading from stdin (XXX support private keys on stdin).
1015 * If it's not a private key, then this must be prepared to
1085 struct sshkey *private, *public;
1090 public = private = NULL;
1096 /* Check whether private key exists and is not zero-length */
1125 error("Could not save your private key in %s: %s",
1132 if ((r = sshkey_generate(type, bits, &private)) != 0) {
1136 if ((r = sshkey_from_private(private, &public)) != 0)
1140 if ((r = sshkey_save_private(private, prv_tmp, "",
1173 sshkey_free(private);
1427 struct sshkey *private;
1435 r = sshkey_load_private(identity_file, "", &private, &comment);
1444 &private, &comment);
1480 if ((r = sshkey_save_private(private, identity_file, passphrase1,
1484 sshkey_free(private);
1490 sshkey_free(private); /* Destroys contents */
1535 * Change the comment of a private key file.
1541 struct sshkey *private;
1551 &private, &comment)) == 0)
1554 fatal_r(r, "Cannot load private key \"%s\"", identity_file);
1565 &private, &comment)) != 0) {
1567 fatal_r(r, "Cannot load private key \"%s\"",
1572 if (private->type != KEY_ED25519 && private->type != KEY_XMSS &&
1577 sshkey_free(private);
1592 sshkey_free(private);
1600 sshkey_free(private);
1606 if ((r = sshkey_save_private(private, identity_file, passphrase,
1611 sshkey_free(private);
1616 if ((r = sshkey_from_private(private, &public)) != 0)
1618 sshkey_free(private);
1732 struct sshkey **keys = NULL, *public, *private = NULL;
1745 private = keys[i];
1752 return private;
1817 /* CA key is assumed to be a private key on the filesystem */
2536 * private key. This lets us specify certificates on the command-line
2537 * and have ssh-keygen find the appropriate private key.
2545 debug_f("%s looks like a public key, using private key "
2550 fatal("No private key found for public key \"%s\"", keypath);
2553 debug_fr(r, "load private key \"%s\"", privpath);
2554 fatal("No private key found for \"%s\"", privpath);
2559 error("Public key %s doesn't match private %s",
2565 * Graft the certificate onto the private key to make
2763 /* Not using agent - try to load private key */
3360 struct sshkey *private, *public;
3829 printf("Generating public/private %s key pair.\n",
3881 &private, attest);
3909 if ((r = sshkey_generate(type, bits, &private)) != 0)
3913 if ((r = sshkey_from_private(private, &public)) != 0)
3926 /* Determine the passphrase for the private key */
3936 if ((r = sshkey_save_private(private, identity_file, passphrase,
3943 sshkey_free(private);