goto end;
}
- out = bio_open_owner(outfile, outformat, private);
- if (out == NULL)
- goto end;
-
if (pubin)
pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
else
if (pkey == NULL)
goto end;
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
#ifndef OPENSSL_NO_EC
if (asn1_encoding != NULL || point_format != NULL) {
OSSL_PARAM params[3], *p = params;
=item B<-in> I<filename>|I<uri>
-This specifies the input to read a key from
+This specifies the input file to read a key from
or standard input if this option is not specified.
+
If the key input is encrypted and B<-passin> is not given
a pass phrase will be prompted for.
=item B<-out> I<filename>
-This specifies the output filename to save the encoded and/or text output of key
+This specifies the output file to save the encoded and/or text output of key
or standard output if this option is not specified.
+The output filename can be the same as the input filename,
+which leads to replacing the file contents.
+Note that file I/O is not atomic. The output file is truncated and then written.
+
If any cipher option is set but no B<-passout> is given
then a pass phrase will be prompted for.
-The output filename should B<not> be the same as the input filename.
+When password input is interrupted, the output file is not touched.
=item B<-outform> B<DER>|B<PEM>