blob: 1893d8cecb13283531e30b9a8092a97575a0a407 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
@deftypefun {int} {gnutls_x509_privkey_import} (gnutls_x509_privkey_t @var{key}, const gnutls_datum_t * @var{data}, gnutls_x509_crt_fmt_t @var{format})
@var{key}: The data to store the parsed key
@var{data}: The DER or PEM encoded certificate.
@var{format}: One of DER or PEM
This function will convert the given DER or PEM encoded key to the
native @code{gnutls_x509_privkey_t} format. The output will be stored in
@code{key} .
If the key is PEM encoded it should have a header that contains "PRIVATE
KEY". Note that this function falls back to PKCS @code{8} decoding without
password, if the default format fails to import.
@strong{Returns:} On success, @code{GNUTLS_E_SUCCESS} (0) is returned, otherwise a
negative error value.
@end deftypefun
|