Fix OSSL_DECODER_new_for_pkey() selection parameter documentation

Fixes #14518

EVP_PKEY_fromdata() already defines this value so we link to this
documentation, 0 is also added as a possible input value.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15260)
This commit is contained in:
Shane Lontis 2021-05-13 18:03:42 +10:00
parent a1f63873ce
commit 00b8706c71
2 changed files with 10 additions and 31 deletions

View File

@ -108,6 +108,13 @@ C<type-specific>. This is the structure used for keys encoded
according to key type specific specifications. For example, RSA keys
encoded according to PKCS#1.
=head2 Selections
I<selection> can be any one of the values described in
L<EVP_PKEY_fromdata(3)/Selections>.
Additionally I<selection> can also be set to B<0> to indicate that the code will
auto detect the selection.
=head1 RETURN VALUES
OSSL_DECODER_CTX_new_for_pkey() returns a pointer to a

View File

@ -108,38 +108,10 @@ The output is the I<selection> of the I<pkey> in PEM format.
=head2 Selections
=begin comment
I<selection> can be any one of the values described in
L<EVP_PKEY_fromdata(3)/Selections>.
These constants should really be documented among the EVP manuals, but this
will have to do for now.
=end comment
The following constants can be used for standard I<selection>:
=over 4
=item B<EVP_PKEY_KEY_PARAMETERS>
Indicates that only the key parameters should be included in the output.
Where it matters, the data type in the output will indicate that the data is
parameters, not a key.
=item B<EVP_PKEY_PUBLIC_KEY>
Indicates that the public key and eventual key parameters will be included
in the output. Where it matters, the data type in the output will indicate
that the data is a public key.
=item B<EVP_PKEY_KEYPAIR>
Indicates that the private key, the public key and eventual key parameters
should be included in the output. Where it matters, the data type in the
output will indicate that the data is a private key.
=back
These are only indications, the encoder implementations are free to
These are only 'hints' since the encoder implementations are free to
determine what makes sense to include in the output, and this may depend on
the desired output. For example, an EC key in a PKCS#8 structure doesn't
usually include the public key.