JcatBlob: libjcat Reference Manual

## JcatBlob JcatBlob |

## Functions

JcatBlobKind | jcat_blob_kind_from_string ()
const gchar * | jcat_blob_kind_to_string ()
const gchar * | jcat_blob_kind_to_filename_ext ()
JcatBlob * | jcat_blob_new ()
JcatBlob * | jcat_blob_new_full ()
JcatBlob * | jcat_blob_new_utf8 ()
gchar * | jcat_blob_to_string ()
GBytes * | jcat_blob_get_data ()
gchar * | jcat_blob_get_data_as_string ()
JcatBlobKind | jcat_blob_get_kind ()
gint64 | jcat_blob_get_timestamp ()
void | jcat_blob_set_timestamp ()
const gchar * | jcat_blob_get_appstream_id ()
void | jcat_blob_set_appstream_id ()

## Types and Values

#define | JCAT_TYPE_BLOB
enum | JcatBlobKind
enum | JcatBlobFlags
struct | JcatBlobClass
| JcatBlob

## Description

## Functions

### jcat_blob_kind_from_string ()

    JcatBlobKind
    jcat_blob_kind_from_string (const gchar *kind);

Converts the string to an enumerated kind.

#### Parameters

kind | A string |

#### Returns

a JcatBlobKind, or `JCAT_BLOB_KIND_UNKNOWN` if the kind was not found

Since: 0.1.0

### jcat_blob_kind_to_string ()

    const gchar *
    jcat_blob_kind_to_string (JcatBlobKind kind);

Converts the enumerated kind to a string.

#### Parameters

kind | JcatBlobKind |

#### Returns

a string, or `NULL` if the kind was not found

Since: 0.1.0

### jcat_blob_kind_to_filename_ext ()

    const gchar *
    jcat_blob_kind_to_filename_ext (JcatBlobKind kind);

Converts the enumerated kind to the normal file extension.

#### Parameters

kind | JcatBlobKind |

#### Returns

a string, or `NULL` if the kind was not found

Since: 0.1.0

### jcat_blob_new ()

    JcatBlob *
    jcat_blob_new (JcatBlobKind kind,
                   GBytes *data);

Creates a new blob.

#### Parameters

kind | JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256` |
data | GBytes |

#### Returns

a JcatBlob

Since: 0.1.0

### jcat_blob_new_full ()

    JcatBlob *
    jcat_blob_new_full (JcatBlobKind kind,
                        GBytes *data,
                        JcatBlobFlags flags);

Creates a new blob.

#### Parameters

kind | JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256` |
data | GBytes |
flags | JcatBlobFlags |

#### Returns

a JcatBlob

Since: 0.1.0

### jcat_blob_new_utf8 ()

    JcatBlob *
    jcat_blob_new_utf8 (JcatBlobKind kind,
                        const gchar *data);

Creates a new ASCII blob.

#### Parameters

kind | JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256` |
data | ASCII data |

#### Returns

a JcatBlob

Since: 0.1.0

### jcat_blob_to_string ()

    gchar *
    jcat_blob_to_string (JcatBlob *self);

Converts the JcatBlob to a string.

#### Parameters

self | JcatBlob |

#### Returns

string

Since: 0.1.0

### jcat_blob_get_data ()

    GBytes *
    jcat_blob_get_data (JcatBlob *self);

Gets the data stored in the blob, typically in binary (unprintable) form.

#### Parameters

self | JcatBlob |

#### Returns

a GBytes, or `NULL` if the filename was not found.

[transfer none]

Since: 0.1.0

### jcat_blob_get_data_as_string ()

    gchar *
    jcat_blob_get_data_as_string (JcatBlob *self);

Gets the data stored in the blob, in human readable form.

#### Parameters

self | JcatBlob |

#### Returns

base64 encoded version of data.

[transfer full]

Since: 0.1.0

### jcat_blob_get_kind ()

    JcatBlobKind
    jcat_blob_get_kind (JcatBlob *self);

gets the blob kind

#### Parameters

self | JcatBlob |

#### Returns

JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256`

Since: 0.1.0

### jcat_blob_get_timestamp ()

    gint64
    jcat_blob_get_timestamp (JcatBlob *self);

Gets the creation timestamp for the blob.

#### Parameters

self | JcatBlob |

#### Returns

UTC UNIX time, or 0 if unset

Since: 0.1.0

### jcat_blob_set_timestamp ()

    void
    jcat_blob_set_timestamp (JcatBlob *self,
                             gint64 timestamp);

Sets the creation timestamp for the blob.

#### Parameters

self | JcatBlob |
timestamp | UTC timestamp |

Since: 0.1.0

### jcat_blob_get_appstream_id ()

    const gchar *
    jcat_blob_get_appstream_id (JcatBlob *self);

Gets the optional AppStream ID for the blob.

#### Parameters

self | JcatBlob |

#### Returns

a string, or `NULL` if not set

Since: 0.1.0

### jcat_blob_set_appstream_id ()

    void
    jcat_blob_set_appstream_id (JcatBlob *self,
                                const gchar *appstream_id);

Sets an optional AppStream ID on the blob.

#### Parameters

self | JcatBlob |
appstream_id | string. | [nullable]

Since: 0.1.0

## Types and Values

### JCAT_TYPE_BLOB

    #define JCAT_TYPE_BLOB jcat_blob_get_type()

### enum JcatBlobKind

The kind of blob stored as a signature on the item.

#### Members

JCAT_BLOB_KIND_UNKNOWN | No known blob kind |
JCAT_BLOB_KIND_SHA256 | SHA-256 checksum |
JCAT_BLOB_KIND_GPG | GPG detached signature |
JCAT_BLOB_KIND_PKCS7 | PKCS-7 detached signature |
JCAT_BLOB_KIND_SHA1 | SHA-1 checksum |

### enum JcatBlobFlags

Flags used when creating the blob.

#### Members

JCAT_BLOB_FLAG_NONE | Generic binary data |
JCAT_BLOB_FLAG_IS_UTF8 | ASCII text |

### struct JcatBlobClass

    struct JcatBlobClass {
    	GObjectClass		 parent_class;
    	gpointer		 padding[15];
    };

### JcatBlob

    typedef struct _JcatBlob JcatBlob;