8 #define MAX_PARAMS_SIZE 6 /* ok for RSA and DSA */
10 /* parameters should not be larger than this limit */
11 #define MAX_PARAMETER_SIZE 1200
12 #define DSA_PRIVATE_PARAMS 5
13 #define DSA_PUBLIC_PARAMS 4
14 #define RSA_PRIVATE_PARAMS 6
15 #define RSA_PUBLIC_PARAMS 2
17 #if MAX_PARAMS_SIZE - RSA_PRIVATE_PARAMS < 0
18 # error INCREASE MAX_PARAMS
21 #if MAX_PARAMS_SIZE - DSA_PRIVATE_PARAMS < 0
22 # error INCREASE MAX_PARAMS
25 typedef struct gnutls_cert
{
26 MPI params
[MAX_PARAMS_SIZE
]; /* the size of params depends on the public
29 * [1] is public exponent
35 int params_size
; /* holds the size of MPI params */
37 PKAlgorithm subject_pk_algorithm
;
39 gnutls_datum signature
;
41 time_t expiration_time
;
42 time_t activation_time
;
47 uint16 keyUsage
; /* bits from X509KEY_*
50 int valid
; /* 0 if the certificate looks good.
53 int CA
; /* 0 if the certificate does not belong to
54 * a certificate authority. 1 otherwise.
57 /* holds the type (PGP, X509)
59 CertificateType cert_type
;
61 gnutls_datum raw
; /* the raw certificate */
65 MPI params
[MAX_PARAMS_SIZE
];/* the size of params depends on the public
70 * [1] is public exponent
71 * [2] is private exponent
74 * [5] is coefficient (u == inverse of p mod q)
78 * [3] is y (public key)
79 * [4] is x (private key)
81 int params_size
; /* holds the number of params */
83 PKAlgorithm pk_algorithm
;
85 gnutls_datum raw
; /* the raw key */
88 struct GNUTLS_STATE_INT
; /* because GNUTLS_STATE is not defined when this file is included */
90 int _gnutls_cert_supported_kx( const gnutls_cert
* cert
, KXAlgorithm
**alg
, int *alg_size
);
91 PKAlgorithm
_gnutls_map_pk_get_pk(KXAlgorithm kx_algorithm
);
93 void _gnutls_free_cert(gnutls_cert cert
);