|
Packit |
c4476c |
=pod
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 NAME
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_md,
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md,
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
|
|
Packit |
c4476c |
- EVP_PKEY RSA-PSS algorithm support functions
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 SYNOPSIS
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
#include <openssl/rsa.h>
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *pctx,
|
|
Packit |
c4476c |
const EVP_MD *md);
|
|
Packit |
c4476c |
int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *pctx,
|
|
Packit |
c4476c |
const EVP_MD *md);
|
|
Packit |
c4476c |
int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *pctx,
|
|
Packit |
c4476c |
int saltlen);
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 DESCRIPTION
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
These are the functions that implement L<RSA-PSS(7)>.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head2 Signing and Verification
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
The macro EVP_PKEY_CTX_set_rsa_padding() is supported but an error is
|
|
Packit |
c4476c |
returned if an attempt is made to set the padding mode to anything other
|
|
Packit |
c4476c |
than B<PSS>. It is otherwise similar to the B<RSA> version.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
The EVP_PKEY_CTX_set_rsa_pss_saltlen() macro is used to set the salt length.
|
|
Packit |
c4476c |
If the key has usage restrictions then an error is returned if an attempt is
|
|
Packit |
c4476c |
made to set the salt length below the minimum value. It is otherwise similar
|
|
Packit |
c4476c |
to the B<RSA> operation except detection of the salt length (using
|
|
Packit |
c4476c |
RSA_PSS_SALTLEN_AUTO) is not supported for verification if the key has
|
|
Packit |
c4476c |
usage restrictions.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
The EVP_PKEY_CTX_set_signature_md() and EVP_PKEY_CTX_set_rsa_mgf1_md() macros
|
|
Packit |
c4476c |
are used to set the digest and MGF1 algorithms respectively. If the key has
|
|
Packit |
c4476c |
usage restrictions then an error is returned if an attempt is made to set the
|
|
Packit |
c4476c |
digest to anything other than the restricted value. Otherwise these are
|
|
Packit |
c4476c |
similar to the B<RSA> versions.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head2 Key Generation
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
As with RSA key generation the EVP_PKEY_CTX_set_rsa_keygen_bits()
|
|
Packit |
c4476c |
and EVP_PKEY_CTX_set_rsa_keygen_pubexp() macros are supported for RSA-PSS:
|
|
Packit |
c4476c |
they have exactly the same meaning as for the RSA algorithm.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
Optional parameter restrictions can be specified when generating a PSS key.
|
|
Packit |
c4476c |
If any restrictions are set (using the macros described below) then B<all>
|
|
Packit |
c4476c |
parameters are restricted. For example, setting a minimum salt length also
|
|
Packit |
c4476c |
restricts the digest and MGF1 algorithms. If any restrictions are in place
|
|
Packit |
c4476c |
then they are reflected in the corresponding parameters of the public key
|
|
Packit |
c4476c |
when (for example) a certificate request is signed.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_md() restricts the digest algorithm the
|
|
Packit |
c4476c |
generated key can use to B<md>.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md() restricts the MGF1 algorithm the
|
|
Packit |
c4476c |
generated key can use to B<md>.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen() restricts the minimum salt length
|
|
Packit |
c4476c |
to B<saltlen>.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 NOTES
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
A context for the B<RSA-PSS> algorithm can be obtained by calling:
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA_PSS, NULL);
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 RETURN VALUES
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
All these functions return 1 for success and 0 or a negative value for failure.
|
|
Packit |
c4476c |
In particular a return value of -2 indicates the operation is not supported by
|
|
Packit |
c4476c |
the public key algorithm.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 SEE ALSO
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
L<RSA-PSS(7)>,
|
|
Packit |
c4476c |
L<EVP_PKEY_CTX_new(3)>,
|
|
Packit |
c4476c |
L<EVP_PKEY_CTX_ctrl_str(3)>,
|
|
Packit |
c4476c |
L<EVP_PKEY_derive(3)>
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=head1 COPYRIGHT
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit |
c4476c |
this file except in compliance with the License. You can obtain a copy
|
|
Packit |
c4476c |
in the file LICENSE in the source distribution or at
|
|
Packit |
c4476c |
L<https://www.openssl.org/source/license.html>.
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
=cut
|