Blame doc/functions/gnutls_x509_crt_get_authority_info_access

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {int} {gnutls_x509_crt_get_authority_info_access} (gnutls_x509_crt_t @var{crt}, unsigned int @var{seq}, int @var{what}, gnutls_datum_t * @var{data}, unsigned int * @var{critical})
Packit aea12f
@var{crt}: Holds the certificate
Packit aea12f
Packit aea12f
@var{seq}: specifies the sequence number of the access descriptor (0 for the first one, 1 for the second etc.)
Packit aea12f
Packit aea12f
@var{what}: what data to get, a @code{gnutls_info_access_what_t}  type.
Packit aea12f
Packit aea12f
@var{data}: output data to be freed with @code{gnutls_free()} .
Packit aea12f
Packit aea12f
@var{critical}: pointer to output integer that is set to non-zero if the extension is marked as critical (may be @code{NULL} )
Packit aea12f
Packit aea12f
Note that a simpler API to access the authority info data is provided
Packit aea12f
by @code{gnutls_x509_aia_get()}  and @code{gnutls_x509_ext_import_aia()} .
Packit aea12f
Packit aea12f
This function extracts the Authority Information Access (AIA)
Packit aea12f
extension, see RFC 5280 section 4.2.2.1 for more information.  The
Packit aea12f
AIA extension holds a sequence of AccessDescription (AD) data.
Packit aea12f
Packit aea12f
The  @code{seq} input parameter is used to indicate which member of the
Packit aea12f
sequence the caller is interested in.  The first member is 0, the
Packit aea12f
second member 1 and so on.  When the  @code{seq} value is out of bounds,
Packit aea12f
@code{GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE}  is returned.
Packit aea12f
Packit aea12f
The type of data returned in  @code{data} is specified via  @code{what} which
Packit aea12f
should be @code{gnutls_info_access_what_t}  values.
Packit aea12f
Packit aea12f
If  @code{what} is @code{GNUTLS_IA_ACCESSMETHOD_OID}  then  @code{data} will hold the
Packit aea12f
accessMethod OID (e.g., "1.3.6.1.5.5.7.48.1").
Packit aea12f
Packit aea12f
If  @code{what} is @code{GNUTLS_IA_ACCESSLOCATION_GENERALNAME_TYPE} ,  @code{data} will
Packit aea12f
hold the accessLocation GeneralName type (e.g.,
Packit aea12f
"uniformResourceIdentifier").
Packit aea12f
Packit aea12f
If  @code{what} is @code{GNUTLS_IA_URI} ,  @code{data} will hold the accessLocation URI
Packit aea12f
data.  Requesting this  @code{what} value leads to an error if the
Packit Service 991b93
accessLocation is not of the "uniformResourceIdentifier" type.
Packit aea12f
Packit aea12f
If  @code{what} is @code{GNUTLS_IA_OCSP_URI} ,  @code{data} will hold the OCSP URI.
Packit aea12f
Requesting this  @code{what} value leads to an error if the accessMethod
Packit aea12f
is not 1.3.6.1.5.5.7.48.1 aka OCSP, or if accessLocation is not of
Packit aea12f
the "uniformResourceIdentifier" type. In that case @code{GNUTLS_E_UNKNOWN_ALGORITHM} 
Packit aea12f
will be returned, and  @code{seq} should be increased and this function
Packit aea12f
called again.
Packit aea12f
Packit aea12f
If  @code{what} is @code{GNUTLS_IA_CAISSUERS_URI} ,  @code{data} will hold the caIssuers
Packit aea12f
URI.  Requesting this  @code{what} value leads to an error if the
Packit aea12f
accessMethod is not 1.3.6.1.5.5.7.48.2 aka caIssuers, or if
Packit aea12f
accessLocation is not of the "uniformResourceIdentifier" type.
Packit aea12f
In that case handle as in @code{GNUTLS_IA_OCSP_URI} .
Packit aea12f
Packit aea12f
More  @code{what} values may be allocated in the future as needed.
Packit aea12f
Packit aea12f
If  @code{data} is NULL, the function does the same without storing the
Packit aea12f
output data, that is, it will set  @code{critical} and do error checking
Packit aea12f
as usual.
Packit aea12f
Packit aea12f
The value of the critical flag is returned in * @code{critical} .  Supply a
Packit aea12f
NULL  @code{critical} if you want the function to make sure the extension
Packit aea12f
is non-critical, as required by RFC 5280.
Packit aea12f
Packit aea12f
@strong{Returns:} @code{GNUTLS_E_SUCCESS}  on success, @code{GNUTLS_E_INVALID_REQUEST}  on
Packit aea12f
invalid  @code{crt} , @code{GNUTLS_E_CONSTRAINT_ERROR}  if the extension is
Packit aea12f
incorrectly marked as critical (use a non-NULL  @code{critical} to
Packit aea12f
override), @code{GNUTLS_E_UNKNOWN_ALGORITHM}  if the requested OID does
Packit aea12f
not match (e.g., when using @code{GNUTLS_IA_OCSP_URI} ), otherwise a
Packit aea12f
negative error code.
Packit aea12f
Packit aea12f
@strong{Since:} 3.0
Packit aea12f
@end deftypefun