gnutls

## gnutls gnutls |

## Functions

return | gnutls_sec_param_to_pk_bits ()

## Types and Values

#define | HAVE_SSIZE_T
struct | gnutls_priority_st
struct | gnutls_session_int
| gnutls_x509_privkey_int

## Description

## Functions

### gnutls_sec_param_to_pk_bits ()

    return
    gnutls_sec_param_to_pk_bits (GNUTLS_PK_DH Param1);

When generating private and public key pairs a difficult question is which size of "bits" the modulus will be in RSA and the group size in DSA. The easy answer is 1024, which is also wrong. This function will convert a human understandable security parameter to an appropriate size for the specific algorithm.

#### Returns

The number of bits, or (0).

Since 2.12.0

## Types and Values

### HAVE_SSIZE_T

    #define HAVE_SSIZE_T

### struct gnutls_priority_st

    struct gnutls_priority_st {
    	priority_st cipher;
    	priority_st mac;
    	priority_st kx;
    	priority_st compression;
    	priority_st protocol;
    	priority_st cert_type;
    	priority_st sign_algo;
    	priority_st supported_ecc;

    	/* to disable record padding */
    	unsigned int no_extensions:1;
    	unsigned int allow_large_records:1;
    	unsigned int new_record_padding:1;
    	unsigned int max_empty_records;
    	unsigned int dumbfw;
    	safe_renegotiation_t sr;
    	unsigned int ssl3_record_version:1;
    	unsigned int server_precedence:1;
    	unsigned int allow_weak_keys:1;
    	unsigned int allow_wrong_pms:1;
    	/* Whether stateless compression will be used */
    	unsigned int stateless_compression:1;
    	unsigned int additional_verify_flags;

    	/* The session's expected security level.
    	 * Will be used to determine the minimum DH bits,
    	 * (or the acceptable certificate security level).
    	 */
    	gnutls_sec_param_t level;
    	unsigned int dh_prime_bits; /* old (deprecated) variable */
    };

### struct gnutls_session_int

    struct gnutls_session_int {
    	security_parameters_st security_parameters;
    	record_parameters_st *record_parameters[MAX_EPOCH_INDEX];
    	internals_st internals;
    	gnutls_key_st key;
    };

### gnutls_x509_privkey_int

    typedef struct {
    	/* the size of params depends on the public
    	 * key algorithm
    	 */
    	gnutls_pk_params_st params;

    	gnutls_pk_algorithm_t pk_algorithm;

    	ASN1_TYPE key;
    } gnutls_x509_privkey_int;