Top |
#define | GNUTLS_OPENPGP_KEYID_SIZE |
#define | GNUTLS_OPENPGP_MASTER_KEYID_IDX |
enum | gnutls_openpgp_crt_fmt_t |
int gnutls_certificate_set_openpgp_key (gnutls_certificate_credentials_t res
,gnutls_openpgp_crt_t crt
,gnutls_openpgp_privkey_t pkey
);
gnutls_certificate_set_openpgp_key
is deprecated and should not be used in newly-written code.
This function sets a certificate/private key pair in the gnutls_certificate_credentials_t type. This function may be called more than once (in case multiple keys/certificates exist for the server).
Note that this function requires that the preferred key ids have
been set and be used. See gnutls_openpgp_crt_set_preferred_key_id()
.
Otherwise the master key will be used.
int gnutls_certificate_set_openpgp_key_file (gnutls_certificate_credentials_t res
,const char *certfile
,const char *keyfile
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_key_file
is deprecated and should not be used in newly-written code.
This function is used to load OpenPGP keys into the GnuTLS credentials structure. The file should contain at least one valid non encrypted subkey.
int gnutls_certificate_set_openpgp_key_file2 (gnutls_certificate_credentials_t res
,const char *certfile
,const char *keyfile
,const char *subkey_id
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_key_file2
is deprecated and should not be used in newly-written code.
This function is used to load OpenPGP keys into the GnuTLS credential structure. The file should contain at least one valid non encrypted subkey.
The special keyword "auto" is also accepted as subkey_id
. In that
case the gnutls_openpgp_crt_get_auth_subkey()
will be used to
retrieve the subkey.
res |
the destination context to save the data. |
|
certfile |
the file that contains the public key. |
|
keyfile |
the file that contains the secret key. |
|
subkey_id |
a hex encoded subkey id |
|
format |
the format of the keys |
Since: 2.4.0
int gnutls_certificate_set_openpgp_key_mem (gnutls_certificate_credentials_t res
,const gnutls_datum_t *cert
,const gnutls_datum_t *key
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_key_mem
is deprecated and should not be used in newly-written code.
This function is used to load OpenPGP keys into the GnuTLS credential structure. The datum should contain at least one valid non encrypted subkey.
int gnutls_certificate_set_openpgp_key_mem2 (gnutls_certificate_credentials_t res
,const gnutls_datum_t *cert
,const gnutls_datum_t *key
,const char *subkey_id
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_key_mem2
is deprecated and should not be used in newly-written code.
This function is used to load OpenPGP keys into the GnuTLS credentials structure. The datum should contain at least one valid non encrypted subkey.
The special keyword "auto" is also accepted as subkey_id
. In that
case the gnutls_openpgp_crt_get_auth_subkey()
will be used to
retrieve the subkey.
res |
the destination context to save the data. |
|
cert |
the datum that contains the public key. |
|
key |
the datum that contains the secret key. |
|
subkey_id |
a hex encoded subkey id |
|
format |
the format of the keys |
Since: 2.4.0
int gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c
,const char *file
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_keyring_file
is deprecated and should not be used in newly-written code.
The function is used to set keyrings that will be used internally by various OpenPGP functions. For example to find a key when it is needed for an operations. The keyring will also be used at the verification functions.
int gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t c
,const unsigned char *data
,size_t dlen
,gnutls_openpgp_crt_fmt_t format
);
gnutls_certificate_set_openpgp_keyring_mem
is deprecated and should not be used in newly-written code.
The function is used to set keyrings that will be used internally by various OpenPGP functions. For example to find a key when it is needed for an operations. The keyring will also be used at the verification functions.
int gnutls_openpgp_crt_check_hostname (gnutls_openpgp_crt_t key
,const char *hostname
);
gnutls_openpgp_crt_check_hostname
is deprecated and should not be used in newly-written code.
This function will check if the given key's owner matches the given hostname. This is a basic implementation of the matching described in RFC2818 (HTTPS), which takes into account wildcards.
key |
should contain a gnutls_openpgp_crt_t type |
|
hostname |
A null terminated string that contains a DNS name |
void
gnutls_openpgp_crt_deinit (gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_deinit
is deprecated and should not be used in newly-written code.
This function will deinitialize a key structure.
int gnutls_openpgp_crt_export (gnutls_openpgp_crt_t key
,gnutls_openpgp_crt_fmt_t format
,void *output_data
,size_t *output_data_size
);
gnutls_openpgp_crt_export
is deprecated and should not be used in newly-written code.
This function will convert the given key to RAW or Base64 format.
If the buffer provided is not long enough to hold the output, then
GNUTLS_E_SHORT_MEMORY_BUFFER
will be returned.
int gnutls_openpgp_crt_export2 (gnutls_openpgp_crt_t key
,gnutls_openpgp_crt_fmt_t format
,gnutls_datum_t *out
);
gnutls_openpgp_crt_export2
is deprecated and should not be used in newly-written code.
This function will convert the given key to RAW or Base64 format.
The output buffer is allocated using gnutls_malloc()
.
key |
Holds the key. |
|
format |
One of gnutls_openpgp_crt_fmt_t elements. |
|
out |
will contain the raw or base64 encoded key |
Since: 3.1.3
int gnutls_openpgp_crt_get_auth_subkey (gnutls_openpgp_crt_t crt
,gnutls_openpgp_keyid_t keyid
,unsigned int flag
);
gnutls_openpgp_crt_get_auth_subkey
is deprecated and should not be used in newly-written code.
Returns the 64-bit keyID of the first valid OpenPGP subkey marked for authentication. If flag is non-zero and no authentication subkey exists, then a valid subkey will be returned even if it is not marked for authentication.
time_t
gnutls_openpgp_crt_get_creation_time (gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_get_creation_time
is deprecated and should not be used in newly-written code.
Get key creation time.
time_t
gnutls_openpgp_crt_get_expiration_time
(gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_get_expiration_time
is deprecated and should not be used in newly-written code.
Get key expiration time. A value of '0' means that the key doesn't expire at all.
int gnutls_openpgp_crt_get_fingerprint (gnutls_openpgp_crt_t key
,void *fpr
,size_t *fprlen
);
gnutls_openpgp_crt_get_fingerprint
is deprecated and should not be used in newly-written code.
Get key fingerprint. Depending on the algorithm, the fingerprint can be 16 or 20 bytes.
int gnutls_openpgp_crt_get_key_id (gnutls_openpgp_crt_t key
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_crt_get_key_id
is deprecated and should not be used in newly-written code.
Get key id string.
key |
the structure that contains the OpenPGP public key. |
|
keyid |
the buffer to save the keyid. |
Since: 2.4.0
int gnutls_openpgp_crt_get_key_usage (gnutls_openpgp_crt_t key
,unsigned int *key_usage
);
gnutls_openpgp_crt_get_key_usage
is deprecated and should not be used in newly-written code.
This function will return certificate's key usage, by checking the
key algorithm. The key usage value will ORed values of the:
GNUTLS_KEY_DIGITAL_SIGNATURE
, GNUTLS_KEY_KEY_ENCIPHERMENT
.
int gnutls_openpgp_crt_get_name (gnutls_openpgp_crt_t key
,int idx
,char *buf
,size_t *sizeof_buf
);
gnutls_openpgp_crt_get_name
is deprecated and should not be used in newly-written code.
Extracts the userID from the parsed OpenPGP key.
key |
the structure that contains the OpenPGP public key. |
|
idx |
the index of the ID to extract |
|
buf |
a pointer to a structure to hold the name, may be |
|
sizeof_buf |
holds the maximum size of |
GNUTLS_E_SUCCESS
on success, and if the index of the ID
does not exist GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE
, or an
error code.
gnutls_pk_algorithm_t gnutls_openpgp_crt_get_pk_algorithm (gnutls_openpgp_crt_t key
,unsigned int *bits
);
gnutls_openpgp_crt_get_pk_algorithm
is deprecated and should not be used in newly-written code.
This function will return the public key algorithm of an OpenPGP certificate.
If bits is non null, it should have enough size to hold the parameters size in bits. For RSA the bits returned is the modulus. For DSA the bits returned are of the public exponent.
key |
is an OpenPGP key |
|
bits |
if bits is non null it will hold the size of the parameters' in bits |
a member of the gnutls_pk_algorithm_t enumeration on success, or GNUTLS_PK_UNKNOWN on error.
int gnutls_openpgp_crt_get_pk_dsa_raw (gnutls_openpgp_crt_t crt
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *g
,gnutls_datum_t *y
);
gnutls_openpgp_crt_get_pk_dsa_raw
is deprecated and should not be used in newly-written code.
This function will export the DSA public key's parameters found in
the given certificate. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
crt |
Holds the certificate |
|
p |
will hold the p |
|
q |
will hold the q |
|
g |
will hold the g |
|
y |
will hold the y |
Since: 2.4.0
int gnutls_openpgp_crt_get_pk_rsa_raw (gnutls_openpgp_crt_t crt
,gnutls_datum_t *m
,gnutls_datum_t *e
);
gnutls_openpgp_crt_get_pk_rsa_raw
is deprecated and should not be used in newly-written code.
This function will export the RSA public key's parameters found in
the given structure. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
Since: 2.4.0
int gnutls_openpgp_crt_get_preferred_key_id (gnutls_openpgp_crt_t key
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_crt_get_preferred_key_id
is deprecated and should not be used in newly-written code.
Get preferred key id. If it hasn't been set it returns
GNUTLS_E_INVALID_REQUEST
.
int
gnutls_openpgp_crt_get_revoked_status (gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_get_revoked_status
is deprecated and should not be used in newly-written code.
Get revocation status of key.
Since: 2.4.0
int
gnutls_openpgp_crt_get_subkey_count (gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_get_subkey_count
is deprecated and should not be used in newly-written code.
This function will return the number of subkeys present in the given OpenPGP certificate.
Since: 2.4.0
time_t gnutls_openpgp_crt_get_subkey_creation_time (gnutls_openpgp_crt_t key
,unsigned int idx
);
gnutls_openpgp_crt_get_subkey_creation_time
is deprecated and should not be used in newly-written code.
Get subkey creation time.
Since: 2.4.0
time_t gnutls_openpgp_crt_get_subkey_expiration_time (gnutls_openpgp_crt_t key
,unsigned int idx
);
gnutls_openpgp_crt_get_subkey_expiration_time
is deprecated and should not be used in newly-written code.
Get subkey expiration time. A value of '0' means that the key doesn't expire at all.
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_fingerprint (gnutls_openpgp_crt_t key
,unsigned int idx
,void *fpr
,size_t *fprlen
);
gnutls_openpgp_crt_get_subkey_fingerprint
is deprecated and should not be used in newly-written code.
Get key fingerprint of a subkey. Depending on the algorithm, the fingerprint can be 16 or 20 bytes.
key |
the raw data that contains the OpenPGP public key. |
|
idx |
the subkey index |
|
fpr |
the buffer to save the fingerprint, must hold at least 20 bytes. |
|
fprlen |
the integer to save the length of the fingerprint. |
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_id (gnutls_openpgp_crt_t key
,unsigned int idx
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_crt_get_subkey_id
is deprecated and should not be used in newly-written code.
Get the subkey's key-id.
int gnutls_openpgp_crt_get_subkey_idx (gnutls_openpgp_crt_t key
,const gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_crt_get_subkey_idx
is deprecated and should not be used in newly-written code.
Get subkey's index.
Since: 2.4.0
gnutls_pk_algorithm_t gnutls_openpgp_crt_get_subkey_pk_algorithm (gnutls_openpgp_crt_t key
,unsigned int idx
,unsigned int *bits
);
gnutls_openpgp_crt_get_subkey_pk_algorithm
is deprecated and should not be used in newly-written code.
This function will return the public key algorithm of a subkey of an OpenPGP certificate.
If bits is non null, it should have enough size to hold the parameters size in bits. For RSA the bits returned is the modulus. For DSA the bits returned are of the public exponent.
key |
is an OpenPGP key |
|
idx |
is the subkey index |
|
bits |
if bits is non null it will hold the size of the parameters' in bits |
a member of the gnutls_pk_algorithm_t enumeration on success, or GNUTLS_PK_UNKNOWN on error.
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_pk_dsa_raw (gnutls_openpgp_crt_t crt
,unsigned int idx
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *g
,gnutls_datum_t *y
);
gnutls_openpgp_crt_get_subkey_pk_dsa_raw
is deprecated and should not be used in newly-written code.
This function will export the DSA public key's parameters found in
the given certificate. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
crt |
Holds the certificate |
|
idx |
Is the subkey index |
|
p |
will hold the p |
|
q |
will hold the q |
|
g |
will hold the g |
|
y |
will hold the y |
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_pk_rsa_raw (gnutls_openpgp_crt_t crt
,unsigned int idx
,gnutls_datum_t *m
,gnutls_datum_t *e
);
gnutls_openpgp_crt_get_subkey_pk_rsa_raw
is deprecated and should not be used in newly-written code.
This function will export the RSA public key's parameters found in
the given structure. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
crt |
Holds the certificate |
|
idx |
Is the subkey index |
|
m |
will hold the modulus |
|
e |
will hold the public exponent |
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_revoked_status (gnutls_openpgp_crt_t key
,unsigned int idx
);
gnutls_openpgp_crt_get_subkey_revoked_status
is deprecated and should not be used in newly-written code.
Get subkey revocation status. A negative error code indicates an error.
Since: 2.4.0
int gnutls_openpgp_crt_get_subkey_usage (gnutls_openpgp_crt_t key
,unsigned int idx
,unsigned int *key_usage
);
gnutls_openpgp_crt_get_subkey_usage
is deprecated and should not be used in newly-written code.
This function will return certificate's key usage, by checking the
key algorithm. The key usage value will ORed values of
GNUTLS_KEY_DIGITAL_SIGNATURE
or GNUTLS_KEY_KEY_ENCIPHERMENT
.
A negative error code may be returned in case of parsing error.
key |
should contain a gnutls_openpgp_crt_t type |
|
idx |
the subkey index |
|
key_usage |
where the key usage bits will be stored |
Since: 2.4.0
int
gnutls_openpgp_crt_get_version (gnutls_openpgp_crt_t key
);
gnutls_openpgp_crt_get_version
is deprecated and should not be used in newly-written code.
Extract the version of the OpenPGP key.
int gnutls_openpgp_crt_import (gnutls_openpgp_crt_t key
,const gnutls_datum_t *data
,gnutls_openpgp_crt_fmt_t format
);
gnutls_openpgp_crt_import
is deprecated and should not be used in newly-written code.
This function will convert the given RAW or Base64 encoded key to the native gnutls_openpgp_crt_t format. The output will be stored in 'key'.
int
gnutls_openpgp_crt_init (gnutls_openpgp_crt_t *key
);
gnutls_openpgp_crt_init
is deprecated and should not be used in newly-written code.
This function will initialize an OpenPGP key structure.
int gnutls_openpgp_crt_print (gnutls_openpgp_crt_t cert
,gnutls_certificate_print_formats_t format
,gnutls_datum_t *out
);
gnutls_openpgp_crt_print
is deprecated and should not be used in newly-written code.
This function will pretty print an OpenPGP certificate, suitable for display to a human.
The format should be (0) for future compatibility.
The output out
needs to be deallocate using gnutls_free()
.
int gnutls_openpgp_crt_set_preferred_key_id (gnutls_openpgp_crt_t key
,const gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_crt_set_preferred_key_id
is deprecated and should not be used in newly-written code.
This allows setting a preferred key id for the given certificate. This key will be used by functions that involve key handling.
If the provided keyid
is NULL
then the master key is
set as preferred.
int gnutls_openpgp_crt_verify_ring (gnutls_openpgp_crt_t key
,gnutls_openpgp_keyring_t keyring
,unsigned int flags
,unsigned int *verify
);
gnutls_openpgp_crt_verify_ring
is deprecated and should not be used in newly-written code.
Verify all signatures in the key, using the given set of keys (keyring).
The key verification output will be put in verify
and will be one
or more of the gnutls_certificate_status_t enumerated elements
bitwise or'd.
Note that this function does not verify using any "web of trust". You may use GnuPG for that purpose, or any other external PGP application.
int gnutls_openpgp_crt_verify_self (gnutls_openpgp_crt_t key
,unsigned int flags
,unsigned int *verify
);
gnutls_openpgp_crt_verify_self
is deprecated and should not be used in newly-written code.
Verifies the self signature in the key. The key verification
output will be put in verify
and will be one or more of the
gnutls_certificate_status_t enumerated elements bitwise or'd.
int gnutls_openpgp_keyring_check_id (gnutls_openpgp_keyring_t ring
,const gnutls_openpgp_keyid_t keyid
,unsigned int flags
);
gnutls_openpgp_keyring_check_id
is deprecated and should not be used in newly-written code.
Check if a given key ID exists in the keyring.
void
gnutls_openpgp_keyring_deinit (gnutls_openpgp_keyring_t keyring
);
gnutls_openpgp_keyring_deinit
is deprecated and should not be used in newly-written code.
This function will deinitialize a keyring structure.
int gnutls_openpgp_keyring_get_crt (gnutls_openpgp_keyring_t ring
,unsigned int idx
,gnutls_openpgp_crt_t *cert
);
gnutls_openpgp_keyring_get_crt
is deprecated and should not be used in newly-written code.
This function will extract an OpenPGP certificate from the given
keyring. If the index given is out of range
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE
will be returned. The
returned structure needs to be deinited.
ring |
Holds the keyring. |
|
idx |
the index of the certificate to export |
|
cert |
An uninitialized gnutls_openpgp_crt_t type |
int
gnutls_openpgp_keyring_get_crt_count (gnutls_openpgp_keyring_t ring
);
gnutls_openpgp_keyring_get_crt_count
is deprecated and should not be used in newly-written code.
This function will return the number of OpenPGP certificates present in the given keyring.
int gnutls_openpgp_keyring_import (gnutls_openpgp_keyring_t keyring
,const gnutls_datum_t *data
,gnutls_openpgp_crt_fmt_t format
);
gnutls_openpgp_keyring_import
is deprecated and should not be used in newly-written code.
This function will convert the given RAW or Base64 encoded keyring to the native gnutls_openpgp_keyring_t format. The output will be stored in 'keyring'.
int
gnutls_openpgp_keyring_init (gnutls_openpgp_keyring_t *keyring
);
gnutls_openpgp_keyring_init
is deprecated and should not be used in newly-written code.
This function will initialize an keyring structure.
void
gnutls_openpgp_privkey_deinit (gnutls_openpgp_privkey_t key
);
gnutls_openpgp_privkey_deinit
is deprecated and should not be used in newly-written code.
This function will deinitialize a key structure.
int gnutls_openpgp_privkey_export (gnutls_openpgp_privkey_t key
,gnutls_openpgp_crt_fmt_t format
,const char *password
,unsigned int flags
,void *output_data
,size_t *output_data_size
);
gnutls_openpgp_privkey_export
is deprecated and should not be used in newly-written code.
This function will convert the given key to RAW or Base64 format. If the buffer provided is not long enough to hold the output, then GNUTLS_E_SHORT_MEMORY_BUFFER will be returned.
key |
Holds the key. |
|
format |
One of gnutls_openpgp_crt_fmt_t elements. |
|
password |
the password that will be used to encrypt the key. (unused for now) |
|
flags |
(0) for future compatibility |
|
output_data |
will contain the key base64 encoded or raw |
|
output_data_size |
holds the size of output_data (and will be replaced by the actual size of parameters) |
Since: 2.4.0
int gnutls_openpgp_privkey_export2 (gnutls_openpgp_privkey_t key
,gnutls_openpgp_crt_fmt_t format
,const char *password
,unsigned int flags
,gnutls_datum_t *out
);
gnutls_openpgp_privkey_export2
is deprecated and should not be used in newly-written code.
This function will convert the given key to RAW or Base64 format.
The output buffer is allocated using gnutls_malloc()
.
key |
Holds the key. |
|
format |
One of gnutls_openpgp_crt_fmt_t elements. |
|
password |
the password that will be used to encrypt the key. (unused for now) |
|
flags |
(0) for future compatibility |
|
out |
will contain the raw or based64 encoded key |
Since: 3.1.3
int gnutls_openpgp_privkey_export_dsa_raw (gnutls_openpgp_privkey_t pkey
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *g
,gnutls_datum_t *y
,gnutls_datum_t *x
);
gnutls_openpgp_privkey_export_dsa_raw
is deprecated and should not be used in newly-written code.
This function will export the DSA private key's parameters found in
the given certificate. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
pkey |
Holds the certificate |
|
p |
will hold the p |
|
q |
will hold the q |
|
g |
will hold the g |
|
y |
will hold the y |
|
x |
will hold the x |
Since: 2.4.0
int gnutls_openpgp_privkey_export_rsa_raw (gnutls_openpgp_privkey_t pkey
,gnutls_datum_t *m
,gnutls_datum_t *e
,gnutls_datum_t *d
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *u
);
gnutls_openpgp_privkey_export_rsa_raw
is deprecated and should not be used in newly-written code.
This function will export the RSA private key's parameters found in
the given structure. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
pkey |
Holds the certificate |
|
m |
will hold the modulus |
|
e |
will hold the public exponent |
|
d |
will hold the private exponent |
|
p |
will hold the first prime (p) |
|
q |
will hold the second prime (q) |
|
u |
will hold the coefficient |
Since: 2.4.0
int gnutls_openpgp_privkey_export_subkey_dsa_raw (gnutls_openpgp_privkey_t pkey
,unsigned int idx
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *g
,gnutls_datum_t *y
,gnutls_datum_t *x
);
gnutls_openpgp_privkey_export_subkey_dsa_raw
is deprecated and should not be used in newly-written code.
This function will export the DSA private key's parameters found
in the given certificate. The new parameters will be allocated
using gnutls_malloc()
and will be stored in the appropriate datum.
pkey |
Holds the certificate |
|
idx |
Is the subkey index |
|
p |
will hold the p |
|
q |
will hold the q |
|
g |
will hold the g |
|
y |
will hold the y |
|
x |
will hold the x |
Since: 2.4.0
int gnutls_openpgp_privkey_export_subkey_rsa_raw (gnutls_openpgp_privkey_t pkey
,unsigned int idx
,gnutls_datum_t *m
,gnutls_datum_t *e
,gnutls_datum_t *d
,gnutls_datum_t *p
,gnutls_datum_t *q
,gnutls_datum_t *u
);
gnutls_openpgp_privkey_export_subkey_rsa_raw
is deprecated and should not be used in newly-written code.
This function will export the RSA private key's parameters found in
the given structure. The new parameters will be allocated using
gnutls_malloc()
and will be stored in the appropriate datum.
pkey |
Holds the certificate |
|
idx |
Is the subkey index |
|
m |
will hold the modulus |
|
e |
will hold the public exponent |
|
d |
will hold the private exponent |
|
p |
will hold the first prime (p) |
|
q |
will hold the second prime (q) |
|
u |
will hold the coefficient |
Since: 2.4.0
int gnutls_openpgp_privkey_get_fingerprint (gnutls_openpgp_privkey_t key
,void *fpr
,size_t *fprlen
);
gnutls_openpgp_privkey_get_fingerprint
is deprecated and should not be used in newly-written code.
Get the fingerprint of the OpenPGP key. Depends on the algorithm, the fingerprint can be 16 or 20 bytes.
key |
the raw data that contains the OpenPGP secret key. |
|
fpr |
the buffer to save the fingerprint, must hold at least 20 bytes. |
|
fprlen |
the integer to save the length of the fingerprint. |
Since: 2.4.0
int gnutls_openpgp_privkey_get_key_id (gnutls_openpgp_privkey_t key
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_privkey_get_key_id
is deprecated and should not be used in newly-written code.
Get key-id.
key |
the structure that contains the OpenPGP secret key. |
|
keyid |
the buffer to save the keyid. |
Since: 2.4.0
gnutls_pk_algorithm_t gnutls_openpgp_privkey_get_pk_algorithm (gnutls_openpgp_privkey_t key
,unsigned int *bits
);
gnutls_openpgp_privkey_get_pk_algorithm
is deprecated and should not be used in newly-written code.
This function will return the public key algorithm of an OpenPGP certificate.
If bits is non null, it should have enough size to hold the parameters size in bits. For RSA the bits returned is the modulus. For DSA the bits returned are of the public exponent.
key |
is an OpenPGP key |
|
bits |
if bits is non null it will hold the size of the parameters' in bits |
a member of the gnutls_pk_algorithm_t enumeration on success, or a negative error code on error.
Since: 2.4.0
int gnutls_openpgp_privkey_get_preferred_key_id (gnutls_openpgp_privkey_t key
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_privkey_get_preferred_key_id
is deprecated and should not be used in newly-written code.
Get the preferred key-id for the key.
key |
the structure that contains the OpenPGP public key. |
|
keyid |
the struct to save the keyid. |
the 64-bit preferred keyID of the OpenPGP key, or if it
hasn't been set it returns GNUTLS_E_INVALID_REQUEST
.
int
gnutls_openpgp_privkey_get_revoked_status
(gnutls_openpgp_privkey_t key
);
gnutls_openpgp_privkey_get_revoked_status
is deprecated and should not be used in newly-written code.
Get revocation status of key.
true (1) if the key has been revoked, or false (0) if it has not, or a negative error code indicates an error.
Since: 2.4.0
int
gnutls_openpgp_privkey_get_subkey_count
(gnutls_openpgp_privkey_t key
);
gnutls_openpgp_privkey_get_subkey_count
is deprecated and should not be used in newly-written code.
This function will return the number of subkeys present in the given OpenPGP certificate.
Since: 2.4.0
time_t gnutls_openpgp_privkey_get_subkey_creation_time (gnutls_openpgp_privkey_t key
,unsigned int idx
);
gnutls_openpgp_privkey_get_subkey_creation_time
is deprecated and should not be used in newly-written code.
Get subkey creation time.
Since: 2.4.0
time_t gnutls_openpgp_privkey_get_subkey_expiration_time (gnutls_openpgp_privkey_t key
,unsigned int idx
);
gnutls_openpgp_privkey_get_subkey_expiration_time
is deprecated and should not be used in newly-written code.
Get subkey expiration time. A value of '0' means that the key doesn't expire at all.
Since: 2.4.0
int gnutls_openpgp_privkey_get_subkey_fingerprint (gnutls_openpgp_privkey_t key
,unsigned int idx
,void *fpr
,size_t *fprlen
);
gnutls_openpgp_privkey_get_subkey_fingerprint
is deprecated and should not be used in newly-written code.
Get the fingerprint of an OpenPGP subkey. Depends on the algorithm, the fingerprint can be 16 or 20 bytes.
key |
the raw data that contains the OpenPGP secret key. |
|
idx |
the subkey index |
|
fpr |
the buffer to save the fingerprint, must hold at least 20 bytes. |
|
fprlen |
the integer to save the length of the fingerprint. |
Since: 2.4.0
int gnutls_openpgp_privkey_get_subkey_id (gnutls_openpgp_privkey_t key
,unsigned int idx
,gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_privkey_get_subkey_id
is deprecated and should not be used in newly-written code.
Get the key-id for the subkey.
key |
the structure that contains the OpenPGP secret key. |
|
idx |
the subkey index |
|
keyid |
the buffer to save the keyid. |
Since: 2.4.0
int gnutls_openpgp_privkey_get_subkey_idx (gnutls_openpgp_privkey_t key
,const gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_privkey_get_subkey_idx
is deprecated and should not be used in newly-written code.
Get index of subkey.
Since: 2.4.0
gnutls_pk_algorithm_t gnutls_openpgp_privkey_get_subkey_pk_algorithm (gnutls_openpgp_privkey_t key
,unsigned int idx
,unsigned int *bits
);
gnutls_openpgp_privkey_get_subkey_pk_algorithm
is deprecated and should not be used in newly-written code.
This function will return the public key algorithm of a subkey of an OpenPGP certificate.
If bits is non null, it should have enough size to hold the parameters size in bits. For RSA the bits returned is the modulus. For DSA the bits returned are of the public exponent.
key |
is an OpenPGP key |
|
idx |
is the subkey index |
|
bits |
if bits is non null it will hold the size of the parameters' in bits |
a member of the gnutls_pk_algorithm_t enumeration on success, or a negative error code on error.
Since: 2.4.0
int gnutls_openpgp_privkey_get_subkey_revoked_status (gnutls_openpgp_privkey_t key
,unsigned int idx
);
gnutls_openpgp_privkey_get_subkey_revoked_status
is deprecated and should not be used in newly-written code.
Get revocation status of key.
true (1) if the key has been revoked, or false (0) if it has not, or a negative error code indicates an error.
Since: 2.4.0
int gnutls_openpgp_privkey_import (gnutls_openpgp_privkey_t key
,const gnutls_datum_t *data
,gnutls_openpgp_crt_fmt_t format
,const char *password
,unsigned int flags
);
gnutls_openpgp_privkey_import
is deprecated and should not be used in newly-written code.
This function will convert the given RAW or Base64 encoded key to the native gnutls_openpgp_privkey_t format. The output will be stored in 'key'.
key |
The structure to store the parsed key. |
|
data |
The RAW or BASE64 encoded key. |
|
format |
One of gnutls_openpgp_crt_fmt_t elements. |
|
password |
not used for now |
|
flags |
should be (0) |
int
gnutls_openpgp_privkey_init (gnutls_openpgp_privkey_t *key
);
gnutls_openpgp_privkey_init
is deprecated and should not be used in newly-written code.
This function will initialize an OpenPGP key structure.
gnutls_sec_param_t
gnutls_openpgp_privkey_sec_param (gnutls_openpgp_privkey_t key
);
gnutls_openpgp_privkey_sec_param
is deprecated and should not be used in newly-written code.
This function will return the security parameter appropriate with this private key.
On success, a valid security parameter is returned otherwise
GNUTLS_SEC_PARAM_UNKNOWN
is returned.
Since: 2.12.0
int gnutls_openpgp_privkey_set_preferred_key_id (gnutls_openpgp_privkey_t key
,const gnutls_openpgp_keyid_t keyid
);
gnutls_openpgp_privkey_set_preferred_key_id
is deprecated and should not be used in newly-written code.
This allows setting a preferred key id for the given certificate. This key will be used by functions that involve key handling.
If the provided keyid
is NULL
then the master key is
set as preferred.
int (*gnutls_openpgp_recv_key_func) (gnutls_session_t session
,const unsigned char *keyfpr
,unsigned int keyfpr_length
,gnutls_datum_t *key
);
A callback of this type is used to retrieve OpenPGP keys. Only
useful on the server, and will only be used if the peer send a key
fingerprint instead of a full key. See also
gnutls_openpgp_set_recv_key_function()
.
The variable key
must be allocated using gnutls_malloc()
.
void gnutls_openpgp_set_recv_key_function (gnutls_session_t session
,gnutls_openpgp_recv_key_func func
);
gnutls_openpgp_set_recv_key_function
is deprecated and should not be used in newly-written code.
This function will set a key retrieval function for OpenPGP keys. This callback is only useful in server side, and will be used if the peer sent a key fingerprint instead of a full key.
The retrieved key must be allocated using gnutls_malloc()
.