1e1051a39Sopenharmony_ci=pod 2e1051a39Sopenharmony_ci 3e1051a39Sopenharmony_ci=head1 NAME 4e1051a39Sopenharmony_ci 5e1051a39Sopenharmony_ciopenssl-format-options - OpenSSL command input and output format options 6e1051a39Sopenharmony_ci 7e1051a39Sopenharmony_ci=head1 SYNOPSIS 8e1051a39Sopenharmony_ci 9e1051a39Sopenharmony_ciB<openssl> 10e1051a39Sopenharmony_ciI<command> 11e1051a39Sopenharmony_ci[ I<options> ... ] 12e1051a39Sopenharmony_ci[ I<parameters> ... ] 13e1051a39Sopenharmony_ci 14e1051a39Sopenharmony_ci=head1 DESCRIPTION 15e1051a39Sopenharmony_ci 16e1051a39Sopenharmony_ciSeveral OpenSSL commands can take input or generate output in a variety 17e1051a39Sopenharmony_ciof formats. 18e1051a39Sopenharmony_ci 19e1051a39Sopenharmony_ciSince OpenSSL 3.0 keys, single certificates, and CRLs can be read from 20e1051a39Sopenharmony_cifiles in any of the B<DER>, B<PEM> or B<P12> formats. Specifying their input 21e1051a39Sopenharmony_ciformat is no more needed and the openssl commands will automatically try all 22e1051a39Sopenharmony_cithe possible formats. However if the B<DER> or B<PEM> input format is specified 23e1051a39Sopenharmony_ciit will be enforced. 24e1051a39Sopenharmony_ci 25e1051a39Sopenharmony_ciIn order to access a key via an engine the input format B<ENGINE> may be used; 26e1051a39Sopenharmony_cialternatively the key identifier in the <uri> argument of the respective key 27e1051a39Sopenharmony_cioption may be preceded by C<org.openssl.engine:>. 28e1051a39Sopenharmony_ciSee L<openssl(1)/Engine Options> for an example usage of the latter. 29e1051a39Sopenharmony_ci 30e1051a39Sopenharmony_ci=head1 OPTIONS 31e1051a39Sopenharmony_ci 32e1051a39Sopenharmony_ci=head2 Format Options 33e1051a39Sopenharmony_ci 34e1051a39Sopenharmony_ciThe options to specify the format are as follows. 35e1051a39Sopenharmony_ciRefer to the individual man page to see which options are accepted. 36e1051a39Sopenharmony_ci 37e1051a39Sopenharmony_ci=over 4 38e1051a39Sopenharmony_ci 39e1051a39Sopenharmony_ci=item B<-inform> I<format>, B<-outform> I<format> 40e1051a39Sopenharmony_ci 41e1051a39Sopenharmony_ciThe format of the input or output streams. 42e1051a39Sopenharmony_ci 43e1051a39Sopenharmony_ci=item B<-keyform> I<format> 44e1051a39Sopenharmony_ci 45e1051a39Sopenharmony_ciFormat of a private key input source. 46e1051a39Sopenharmony_ci 47e1051a39Sopenharmony_ci=item B<-CRLform> I<format> 48e1051a39Sopenharmony_ci 49e1051a39Sopenharmony_ciFormat of a CRL input source. 50e1051a39Sopenharmony_ci 51e1051a39Sopenharmony_ci=back 52e1051a39Sopenharmony_ci 53e1051a39Sopenharmony_ci=head2 Format Option Arguments 54e1051a39Sopenharmony_ci 55e1051a39Sopenharmony_ciThe possible format arguments are described below. 56e1051a39Sopenharmony_ciBoth uppercase and lowercase are accepted. 57e1051a39Sopenharmony_ci 58e1051a39Sopenharmony_ciThe list of acceptable format arguments, and the default, 59e1051a39Sopenharmony_ciis described in each command documentation. 60e1051a39Sopenharmony_ci 61e1051a39Sopenharmony_ci=over 4 62e1051a39Sopenharmony_ci 63e1051a39Sopenharmony_ci=item B<DER> 64e1051a39Sopenharmony_ci 65e1051a39Sopenharmony_ciA binary format, encoded or parsed according to Distinguished Encoding Rules 66e1051a39Sopenharmony_ci(DER) of the ASN.1 data language. 67e1051a39Sopenharmony_ci 68e1051a39Sopenharmony_ci=item B<ENGINE> 69e1051a39Sopenharmony_ci 70e1051a39Sopenharmony_ciUsed to specify that the cryptographic material is in an OpenSSL B<engine>. 71e1051a39Sopenharmony_ciAn engine must be configured or specified using the B<-engine> option. 72e1051a39Sopenharmony_ciA password or PIN may be supplied to the engine using the B<-passin> option. 73e1051a39Sopenharmony_ci 74e1051a39Sopenharmony_ci=item B<P12> 75e1051a39Sopenharmony_ci 76e1051a39Sopenharmony_ciA DER-encoded file containing a PKCS#12 object. 77e1051a39Sopenharmony_ciIt might be necessary to provide a decryption password to retrieve 78e1051a39Sopenharmony_cithe private key. 79e1051a39Sopenharmony_ci 80e1051a39Sopenharmony_ci=item B<PEM> 81e1051a39Sopenharmony_ci 82e1051a39Sopenharmony_ciA text format defined in IETF RFC 1421 and IETF RFC 7468. Briefly, this is 83e1051a39Sopenharmony_cia block of base-64 encoding (defined in IETF RFC 4648), with specific 84e1051a39Sopenharmony_cilines used to mark the start and end: 85e1051a39Sopenharmony_ci 86e1051a39Sopenharmony_ci Text before the BEGIN line is ignored. 87e1051a39Sopenharmony_ci ----- BEGIN object-type ----- 88e1051a39Sopenharmony_ci OT43gQKBgQC/2OHZoko6iRlNOAQ/tMVFNq7fL81GivoQ9F1U0Qr+DH3ZfaH8eIkX 89e1051a39Sopenharmony_ci xT0ToMPJUzWAn8pZv0snA0um6SIgvkCuxO84OkANCVbttzXImIsL7pFzfcwV/ERK 90e1051a39Sopenharmony_ci UM6j0ZuSMFOCr/lGPAoOQU0fskidGEHi1/kW+suSr28TqsyYZpwBDQ== 91e1051a39Sopenharmony_ci ----- END object-type ----- 92e1051a39Sopenharmony_ci Text after the END line is also ignored 93e1051a39Sopenharmony_ci 94e1051a39Sopenharmony_ciThe I<object-type> must match the type of object that is expected. 95e1051a39Sopenharmony_ciFor example a C<BEGIN X509 CERTIFICATE> will not match if the command 96e1051a39Sopenharmony_ciis trying to read a private key. The types supported include: 97e1051a39Sopenharmony_ci 98e1051a39Sopenharmony_ci ANY PRIVATE KEY 99e1051a39Sopenharmony_ci CERTIFICATE 100e1051a39Sopenharmony_ci CERTIFICATE REQUEST 101e1051a39Sopenharmony_ci CMS 102e1051a39Sopenharmony_ci DH PARAMETERS 103e1051a39Sopenharmony_ci DSA PARAMETERS 104e1051a39Sopenharmony_ci DSA PUBLIC KEY 105e1051a39Sopenharmony_ci EC PARAMETERS 106e1051a39Sopenharmony_ci EC PRIVATE KEY 107e1051a39Sopenharmony_ci ECDSA PUBLIC KEY 108e1051a39Sopenharmony_ci ENCRYPTED PRIVATE KEY 109e1051a39Sopenharmony_ci PARAMETERS 110e1051a39Sopenharmony_ci PKCS #7 SIGNED DATA 111e1051a39Sopenharmony_ci PKCS7 112e1051a39Sopenharmony_ci PRIVATE KEY 113e1051a39Sopenharmony_ci PUBLIC KEY 114e1051a39Sopenharmony_ci RSA PRIVATE KEY 115e1051a39Sopenharmony_ci SSL SESSION PARAMETERS 116e1051a39Sopenharmony_ci TRUSTED CERTIFICATE 117e1051a39Sopenharmony_ci X509 CRL 118e1051a39Sopenharmony_ci X9.42 DH PARAMETERS 119e1051a39Sopenharmony_ci 120e1051a39Sopenharmony_ciThe following legacy I<object-type>'s are also supported for compatibility 121e1051a39Sopenharmony_ciwith earlier releases: 122e1051a39Sopenharmony_ci 123e1051a39Sopenharmony_ci DSA PRIVATE KEY 124e1051a39Sopenharmony_ci NEW CERTIFICATE REQUEST 125e1051a39Sopenharmony_ci RSA PUBLIC KEY 126e1051a39Sopenharmony_ci X509 CERTIFICATE 127e1051a39Sopenharmony_ci 128e1051a39Sopenharmony_ci=item B<SMIME> 129e1051a39Sopenharmony_ci 130e1051a39Sopenharmony_ciAn S/MIME object as described in IETF RFC 8551. 131e1051a39Sopenharmony_ciEarlier versions were known as CMS and are compatible. 132e1051a39Sopenharmony_ciNote that the parsing is simple and might fail to parse some legal data. 133e1051a39Sopenharmony_ci 134e1051a39Sopenharmony_ci=back 135e1051a39Sopenharmony_ci 136e1051a39Sopenharmony_ci=head1 COPYRIGHT 137e1051a39Sopenharmony_ci 138e1051a39Sopenharmony_ciCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 139e1051a39Sopenharmony_ci 140e1051a39Sopenharmony_ciLicensed under the Apache License 2.0 (the "License"). You may not use 141e1051a39Sopenharmony_cithis file except in compliance with the License. You can obtain a copy 142e1051a39Sopenharmony_ciin the file LICENSE in the source distribution or at 143e1051a39Sopenharmony_ciL<https://www.openssl.org/source/license.html>. 144e1051a39Sopenharmony_ci 145e1051a39Sopenharmony_ci=cut 146