summaryrefslogtreecommitdiff
path: root/libextra/openpgp/pgp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libextra/openpgp/pgp.c')
-rw-r--r--libextra/openpgp/pgp.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/libextra/openpgp/pgp.c b/libextra/openpgp/pgp.c
index 69182b4692..2e17b7d99b 100644
--- a/libextra/openpgp/pgp.c
+++ b/libextra/openpgp/pgp.c
@@ -34,7 +34,7 @@
/**
- * gnutls_openpgp_key_init - This function initializes a gnutls_openpgp_key_t structure
+ * gnutls_openpgp_crt_init - This function initializes a gnutls_openpgp_crt_t structure
* @key: The structure to be initialized
*
* This function will initialize an OpenPGP key structure.
@@ -43,9 +43,9 @@
*
**/
int
-gnutls_openpgp_key_init (gnutls_openpgp_key_t * key)
+gnutls_openpgp_crt_init (gnutls_openpgp_crt_t * key)
{
- *key = gnutls_calloc (1, sizeof (gnutls_openpgp_key_int));
+ *key = gnutls_calloc (1, sizeof (gnutls_openpgp_crt_int));
if (*key)
return 0; /* success */
@@ -53,13 +53,13 @@ gnutls_openpgp_key_init (gnutls_openpgp_key_t * key)
}
/**
- * gnutls_openpgp_key_deinit - This function deinitializes memory used by a gnutls_openpgp_key_t structure
+ * gnutls_openpgp_crt_deinit - This function deinitializes memory used by a gnutls_openpgp_crt_t structure
* @key: The structure to be initialized
*
* This function will deinitialize a key structure.
**/
void
-gnutls_openpgp_key_deinit (gnutls_openpgp_key_t key)
+gnutls_openpgp_crt_deinit (gnutls_openpgp_crt_t key)
{
if (!key)
return;
@@ -74,20 +74,20 @@ gnutls_openpgp_key_deinit (gnutls_openpgp_key_t key)
}
/**
- * gnutls_openpgp_key_import - This function will import a RAW or BASE64 encoded key
+ * gnutls_openpgp_crt_import - This function will import a RAW or BASE64 encoded key
* @key: The structure to store the parsed key.
* @data: The RAW or BASE64 encoded key.
- * @format: One of gnutls_openpgp_key_fmt_t elements.
+ * @format: One of gnutls_openpgp_crt_fmt_t elements.
*
* This function will convert the given RAW or Base64 encoded key
- * to the native gnutls_openpgp_key_t format. The output will be stored in 'key'.
+ * to the native gnutls_openpgp_crt_t format. The output will be stored in 'key'.
*
* Returns 0 on success.
**/
int
-gnutls_openpgp_key_import (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_import (gnutls_openpgp_crt_t key,
const gnutls_datum_t * data,
- gnutls_openpgp_key_fmt_t format)
+ gnutls_openpgp_crt_fmt_t format)
{
cdk_stream_t inp;
int rc;
@@ -120,9 +120,9 @@ gnutls_openpgp_key_import (gnutls_openpgp_key_t key,
}
/**
- * gnutls_openpgp_key_export - This function will export a RAW or BASE64 encoded key
+ * gnutls_openpgp_crt_export - This function will export a RAW or BASE64 encoded key
* @key: Holds the key.
- * @format: One of gnutls_openpgp_key_fmt_t elements.
+ * @format: One of gnutls_openpgp_crt_fmt_t elements.
* @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)
*
@@ -134,8 +134,8 @@ gnutls_openpgp_key_import (gnutls_openpgp_key_t key,
*
**/
int
-gnutls_openpgp_key_export (gnutls_openpgp_key_t key,
- gnutls_openpgp_key_fmt_t format,
+gnutls_openpgp_crt_export (gnutls_openpgp_crt_t key,
+ gnutls_openpgp_crt_fmt_t format,
void *output_data, size_t * output_data_size)
{
size_t input_data_size = *output_data_size;
@@ -185,7 +185,7 @@ gnutls_openpgp_key_export (gnutls_openpgp_key_t key,
/**
- * gnutls_openpgp_key_get_fingerprint - Gets the fingerprint
+ * gnutls_openpgp_crt_get_fingerprint - Gets the fingerprint
* @key: the raw data that contains the OpenPGP public key.
* @fpr: the buffer to save the fingerprint, must hold at least 20 bytes.
* @fprlen: the integer to save the length of the fingerprint.
@@ -194,7 +194,7 @@ gnutls_openpgp_key_export (gnutls_openpgp_key_t key,
* the fingerprint can be 16 or 20 bytes.
**/
int
-gnutls_openpgp_key_get_fingerprint (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_get_fingerprint (gnutls_openpgp_crt_t key,
void *fpr, size_t * fprlen)
{
cdk_packet_t pkt;
@@ -224,7 +224,7 @@ gnutls_openpgp_key_get_fingerprint (gnutls_openpgp_key_t key,
}
int
-_gnutls_openpgp_count_key_names (gnutls_openpgp_key_t key)
+_gnutls_openpgp_count_key_names (gnutls_openpgp_crt_t key)
{
cdk_kbnode_t p, ctx;
cdk_packet_t pkt;
@@ -250,7 +250,7 @@ _gnutls_openpgp_count_key_names (gnutls_openpgp_key_t key)
/**
- * gnutls_openpgp_key_get_name - Extracts the userID
+ * gnutls_openpgp_crt_get_name - Extracts the userID
* @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
@@ -264,7 +264,7 @@ _gnutls_openpgp_count_key_names (gnutls_openpgp_key_t key)
*
**/
int
-gnutls_openpgp_key_get_name (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_get_name (gnutls_openpgp_crt_t key,
int idx, char *buf, size_t * sizeof_buf)
{
cdk_kbnode_t ctx = NULL, p;
@@ -319,7 +319,7 @@ gnutls_openpgp_key_get_name (gnutls_openpgp_key_t key,
}
/**
- * gnutls_openpgp_key_get_pk_algorithm - This function returns the key's PublicKey algorithm
+ * gnutls_openpgp_crt_get_pk_algorithm - This function returns the key's PublicKey algorithm
* @key: is an OpenPGP key
* @bits: if bits is non null it will hold the size of the parameters' in bits
*
@@ -335,7 +335,7 @@ gnutls_openpgp_key_get_name (gnutls_openpgp_key_t key,
*
**/
gnutls_pk_algorithm_t
-gnutls_openpgp_key_get_pk_algorithm (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_get_pk_algorithm (gnutls_openpgp_crt_t key,
unsigned int *bits)
{
cdk_packet_t pkt;
@@ -364,13 +364,13 @@ gnutls_openpgp_key_get_pk_algorithm (gnutls_openpgp_key_t key,
/**
- * gnutls_openpgp_key_get_version - Extracts the version of the key.
+ * gnutls_openpgp_crt_get_version - Extracts the version of the key.
* @key: the structure that contains the OpenPGP public key.
*
* Extract the version of the OpenPGP key.
**/
int
-gnutls_openpgp_key_get_version (gnutls_openpgp_key_t key)
+gnutls_openpgp_crt_get_version (gnutls_openpgp_crt_t key)
{
cdk_packet_t pkt;
int version;
@@ -389,13 +389,13 @@ gnutls_openpgp_key_get_version (gnutls_openpgp_key_t key)
/**
- * gnutls_openpgp_key_get_creation_time - Extract the timestamp
+ * gnutls_openpgp_crt_get_creation_time - Extract the timestamp
* @key: the structure that contains the OpenPGP public key.
*
* Returns the timestamp when the OpenPGP key was created.
**/
time_t
-gnutls_openpgp_key_get_creation_time (gnutls_openpgp_key_t key)
+gnutls_openpgp_crt_get_creation_time (gnutls_openpgp_crt_t key)
{
cdk_packet_t pkt;
time_t timestamp;
@@ -414,14 +414,14 @@ gnutls_openpgp_key_get_creation_time (gnutls_openpgp_key_t key)
/**
- * gnutls_openpgp_key_get_expiration_time - Extract the expire date
+ * gnutls_openpgp_crt_get_expiration_time - Extract the expire date
* @key: the structure that contains the OpenPGP public key.
*
* Returns the time when the OpenPGP key expires. A value of '0' means
* that the key doesn't expire at all.
**/
time_t
-gnutls_openpgp_key_get_expiration_time (gnutls_openpgp_key_t key)
+gnutls_openpgp_crt_get_expiration_time (gnutls_openpgp_crt_t key)
{
cdk_packet_t pkt;
time_t expiredate;
@@ -439,14 +439,14 @@ gnutls_openpgp_key_get_expiration_time (gnutls_openpgp_key_t key)
}
/**
- * gnutls_openpgp_key_get_id - Gets the keyID
+ * gnutls_openpgp_crt_get_id - Gets the keyID
* @key: the structure that contains the OpenPGP public key.
* @keyid: the buffer to save the keyid.
*
* Returns the 64-bit keyID of the OpenPGP key.
**/
int
-gnutls_openpgp_key_get_id (gnutls_openpgp_key_t key, unsigned char keyid[8])
+gnutls_openpgp_crt_get_id (gnutls_openpgp_crt_t key, unsigned char keyid[8])
{
cdk_packet_t pkt;
uint32_t kid[2];
@@ -475,8 +475,8 @@ gnutls_openpgp_key_get_id (gnutls_openpgp_key_t key, unsigned char keyid[8])
}
/**
- * gnutls_openpgp_key_check_hostname - This function compares the given hostname with the hostname in the key
- * @key: should contain an gnutls_openpgp_key_t structure
+ * gnutls_openpgp_crt_check_hostname - This function compares the given hostname with the hostname in the key
+ * @key: should contain an gnutls_openpgp_crt_t structure
* @hostname: A null terminated string that contains a DNS name
*
* This function will check if the given key's owner matches
@@ -487,7 +487,7 @@ gnutls_openpgp_key_get_id (gnutls_openpgp_key_t key, unsigned char keyid[8])
*
**/
int
-gnutls_openpgp_key_check_hostname (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_check_hostname (gnutls_openpgp_crt_t key,
const char *hostname)
{
char dnsname[MAX_CN];
@@ -499,7 +499,7 @@ gnutls_openpgp_key_check_hostname (gnutls_openpgp_key_t key,
for (i = 0; !(ret < 0); i++)
{
dnsnamesize = sizeof (dnsname);
- ret = gnutls_openpgp_key_get_name (key, i, dnsname, &dnsnamesize);
+ ret = gnutls_openpgp_crt_get_name (key, i, dnsname, &dnsnamesize);
/* FIXME: ret is not used */
if (_gnutls_hostname_compare (dnsname, hostname))
return 1;
@@ -510,8 +510,8 @@ gnutls_openpgp_key_check_hostname (gnutls_openpgp_key_t key,
}
/**
- * gnutls_openpgp_key_get_key_usage - This function returns the key's usage
- * @key: should contain a gnutls_openpgp_key_t structure
+ * gnutls_openpgp_crt_get_key_usage - This function returns the key's usage
+ * @key: should contain a gnutls_openpgp_crt_t structure
* @key_usage: where the key usage bits will be stored
*
* This function will return certificate's key usage, by checking the
@@ -522,7 +522,7 @@ gnutls_openpgp_key_check_hostname (gnutls_openpgp_key_t key,
*
*/
int
-gnutls_openpgp_key_get_key_usage (gnutls_openpgp_key_t key,
+gnutls_openpgp_crt_get_key_usage (gnutls_openpgp_crt_t key,
unsigned int *key_usage)
{
cdk_packet_t pkt;