Blame doc/functions/gnutls_x509_crq_sign2

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {int} {gnutls_x509_crq_sign2} (gnutls_x509_crq_t @var{crq}, gnutls_x509_privkey_t @var{key}, gnutls_digest_algorithm_t @var{dig}, unsigned int @var{flags})
Packit aea12f
@var{crq}: should contain a @code{gnutls_x509_crq_t}  type
Packit aea12f
Packit aea12f
@var{key}: holds a private key
Packit aea12f
Packit aea12f
@var{dig}: The message digest to use, i.e., @code{GNUTLS_DIG_SHA256} 
Packit aea12f
Packit aea12f
@var{flags}: must be 0
Packit aea12f
Packit aea12f
This function will sign the certificate request with a private key.
Packit aea12f
This must be the same key as the one used in
Packit aea12f
@code{gnutls_x509_crt_set_key()}  since a certificate request is self
Packit aea12f
signed.
Packit aea12f
Packit aea12f
This must be the last step in a certificate request generation
Packit aea12f
since all the previously set parameters are now signed.
Packit aea12f
Packit aea12f
A known limitation of this function is, that a newly-signed request will not
Packit aea12f
be fully functional (e.g., for signature verification), until it
Packit aea12f
is exported an re-imported.
Packit aea12f
Packit aea12f
After GnuTLS 3.6.1 the value of  @code{dig} may be @code{GNUTLS_DIG_UNKNOWN} ,
Packit aea12f
and in that case, a suitable but reasonable for the key algorithm will be selected.
Packit aea12f
Packit aea12f
@strong{Returns:} @code{GNUTLS_E_SUCCESS}  on success, otherwise a negative error code.
Packit aea12f
@code{GNUTLS_E_ASN1_VALUE_NOT_FOUND}  is returned if you didn't set all
Packit aea12f
information in the certificate request (e.g., the version using
Packit aea12f
@code{gnutls_x509_crq_set_version()} ).
Packit aea12f
@end deftypefun