Top |
Functions
GckUriData * | gck_uri_data_new () |
GckUriData * | gck_uri_parse () |
gchar * | gck_uri_build () |
GckUriData * | gck_uri_data_copy () |
void | gck_uri_data_free () |
Types and Values
struct | GckUriData |
enum | GckUriError |
enum | GckUriFlags |
#define | GCK_URI_FOR_MODULE_WITH_VERSION |
#define | GCK_URI_FOR_OBJECT_ON_TOKEN |
#define | GCK_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE |
#define | GCK_URI_ERROR |
Description
PKCS\#11 URIsare a standard for referring to PKCS#11 modules, tokens, or objects. What the PKCS#11 URI refers to depends on the context in which it is used.
A PKCS#11 URI can always resolve to more than one object, token or module. A PKCS#11 URI that refers to a token, would (when used in a context that expects objects) refer to all the token on that module.
In most cases the parsing or building of URIs is handled elsewhere in the GCK
library. For example to enumerate objects that match a PKCS#11 URI use the
gck_modules_enumerate_uri()
function.
To parse a PKCS#11 URI use the gck_uri_parse()
function passing in the type of
context in which you're using the URI. To build a URI use the gck_uri_build()
function.
Functions
gck_uri_data_new ()
GckUriData *
gck_uri_data_new (void
);
Allocate a new GckUriData structure. None of the fields will be set.
gck_uri_parse ()
GckUriData * gck_uri_parse (const gchar *string
,GckUriFlags flags
,GError **error
);
Parse a PKCS#11 URI for use in a given context.
The result will contain the fields that are relevant for
the given context. See GckUriData for more info.
Other fields will be set to NULL
.
Parameters
string |
the URI to parse. |
|
flags |
the context in which the URI will be used. |
|
error |
a GError, or |
Returns
a newly allocated GckUriData; which should be
freed with gck_uri_data_free()
.
[transfer full]
gck_uri_build ()
gchar * gck_uri_build (GckUriData *uri_data
,GckUriFlags flags
);
Build a PKCS#11 URI. The various parts relevant to the flags specified will be used to build the URI.
Types and Values
struct GckUriData
struct GckUriData { gboolean any_unrecognized; GckModuleInfo *module_info; GckTokenInfo *token_info; GckAttributes *attributes; };
Information about the contents of a PKCS#11 URI. Various fields may be NULL
depending on the context that the URI was parsed for.
Since PKCS#11 URIs represent a set which results from the intersections of
all of the URI parts, if any_recognized
is set to TRUE
then usually the URI
should be treated as not matching anything.
Members
whether any parts of the PKCS#11 URI were unsupported or unrecognized. |
||
GckModuleInfo * |
information about the PKCS#11 modules matching the URI. |
|
GckTokenInfo * |
information about the PKCS#11 tokens matching the URI. |
|
GckAttributes * |
information about the PKCS#11 objects matching the URI. |
enum GckUriFlags
Which parts of the PKCS#11 URI will be parsed or formatted. These can be combined.
GCK_URI_FOR_MODULE_WITH_VERSION
#define GCK_URI_FOR_MODULE_WITH_VERSION (GCK_URI_WITH_VERSION | GCK_URI_FOR_MODULE)
The URI will match specific version of modules. To be used as a GckUriFlags argument.
GCK_URI_FOR_OBJECT_ON_TOKEN
#define GCK_URI_FOR_OBJECT_ON_TOKEN (GCK_URI_FOR_OBJECT | GCK_URI_FOR_TOKEN)
The URI will match objects on a specific token. To be used as a GckUriFlags argument.
GCK_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE
#define GCK_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE (GCK_URI_FOR_OBJECT_ON_TOKEN | GCK_URI_FOR_MODULE)
The token inserted into a device with a specific module.