Parser
Object Hierarchy:
Gcr.Parser
Gcr.Parser
Gcr.Parser
GLib.Object
GLib.Object
GLib.Object->Gcr.Parser
Description:
[ CCode ( type_id = "gcr_parser_get_type ()" ) ]public class Parser : Object
A parser for parsing various types of files or data.
A `GcrParser` can parse various certificate and key files such as OpenSSL PEM files, DER encoded certifictes, PKCS#8 keys and so on. Each
various format is identified by a value in the [enum@DataFormat] enumeration.
In order to parse data, a new parser is created with Parser and then the [
signal@Parser:GcrParser:authenticate
] and [signal@Parser:GcrParser:parsed
] signals should be connected to. Data
is then fed to the parser via [[email protected] _data] or [[email protected] _stream].
During the [signal@Parser:GcrParser:parsed
] signal the attributes that make up the currently parsed item can be retrieved
using the [[email protected] _parsed_attributes] function.
Content:
Properties:
public Attributes parsed_attributes { get ; }
Get the attributes that make up the currently parsed item.
public string parsed_description { get ; }
The description of the type of the currently parsed item.
public string parsed_label { get ; }
The label of the currently parsed item.
Creation methods:
public Parser ()
Create a new Parser
Methods:
public void add_password (string ? password)
Add a password to the set of passwords to try when parsing locked or
encrypted items.
public void format_disable (DataFormat format)
Disable parsing of the given format.
public void format_enable (DataFormat format)
Enable parsing of the given format.
public bool format_supported (DataFormat format)
Check whether the given format is supported by the parser.
public unowned string get_filename ()
Get the filename of the parser item.
public unowned Parsed get_parsed ()
Get the currently parsed item
public unowned Attributes ? get_parsed_attributes ()
Get the attributes which make up the currently parsed item.
public unowned uint8 []? get_parsed_block ()
Get the raw data block that represents this parsed object.
public unowned Bytes get_parsed_bytes ()
Get the raw data block that represents this parsed object.
public unowned string ? get_parsed_description ()
Get a description for the type of the currently parsed item.
public DataFormat get_parsed_format ()
Get the format of the raw data block that represents this parsed
object.
public unowned string ? get_parsed_label ()
Get the label of the currently parsed item.
public bool parse_bytes (Bytes data) throws Error
Parse the data.
public bool parse_data (uint8 [] data) throws Error
Parse the data.
public bool parse_stream (InputStream input, Cancellable ? cancellable = null ) throws Error
Parse items from the data in a
InputStream .
public async bool parse_stream_async (InputStream input, Cancellable ? cancellable) throws Error
Parse items from the data in a
InputStream .
public void set_filename (string ? filename)
Sets the filename of the parser item.
Signals:
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref