gnutls_certificate_type_get_id - Linux


Overview

gnutls_certificate_type_get_id returns the type identifier of a certificate type. This identifier can be used to create and verify certificates.

Syntax

int gnutls_certificate_type_get_id(const gnutls_certificate_type_t type);

Options/Flags

None.

Examples

/* Get and print the type identifier for a certificate type */
const gnutls_certificate_type_t type = GNUTLS_CRT_X509;
int id = gnutls_certificate_type_get_id(type);
printf("Certificate type ID: %d\n", id);

Common Issues

If the specified certificate type is invalid, the function will return a negative value.

Integration

gnutls_certificate_type_get_id can be used in conjunction with other GNUTLS functions to create and verify certificates. For example, it can be used to create a certificate of a specific type using the gnutls_certificate_create function.

Related Commands