![]() |
![]() |
![]() |
Gck Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
GckUriInfo; enum GckUriParseFlags; GckUriInfo * gck_uri_parse (const gchar *uri
,GckUriParseFlags flags
,GError **error
); gchar * gck_uri_build (GckUriInfo *uri_info
); void gck_uri_info_free (GckUriInfo *uri_info
); #define GCK_URI_ERROR
PKCS\#11 URIs are 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.
typedef struct { gboolean any_unrecognized; GckModuleInfo *module_info; GckTokenInfo *token_info; GckAttributes *attributes; } GckUriInfo;
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.
gboolean |
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. |
typedef enum { GCK_URI_PARSE_MODULE = (1 << 1), GCK_URI_PARSE_TOKEN = (1 << 2) | GCK_URI_PARSE_MODULE, GCK_URI_PARSE_OBJECT = (1 << 3) | GCK_URI_PARSE_TOKEN, GCK_URI_PARSE_ANY = 0xFFFFFFFF, } GckUriParseFlags;
Which context the PKCS#11 URI will be used in.
GckUriInfo * gck_uri_parse (const gchar *uri
,GckUriParseFlags 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 GckUriInfo for more info.
Other fields will be set to NULL
.
|
the URI to parse. |
|
the context in which the URI will be used. |
|
a GError, or NULL . |
Returns : |
a newly allocated GckUriInfo, which should be freed with
gck_uri_info_free() . |
gchar * gck_uri_build (GckUriInfo *uri_info
);
Build a PKCS#11 URI. Any set fields of uri_info
will be used to build
the URI.
|
the info to build the URI from. |
Returns : |
a newly allocated string containing a PKCS#11 URI. |
void gck_uri_info_free (GckUriInfo *uri_info
);
Free a GckUriInfo.
|
URI info to free. |