Pointer to string block
Maximum length of string block
In PKCS#11 structures many strings are encoded in a strange way. The string is placed in a fixed length buffer and then padded with spaces.
This function determines the actual length of the string. Since the string is not null-terminated you need to pass in the size of buffer as max_length. The string will never be longer than this buffer.
Pointer to string block
Maximum length of string block
Lookup a message for the uri error code. These codes are the P11_KIT_URI_XXX error codes that can be returned from p11_kit_uri_parse() or p11_kit_uri_format(). As a special case %NULL, will be returned for %P11_KIT_URI_OK.
The error code
Parse a PKCS#11 URI string.
PKCS#11 URIs can represent tokens, objects or modules. The uri_type argument allows the caller to specify what type of URI is expected and the sorts of things the URI should match. %P11_KIT_URI_FOR_ANY can be used to parse a URI for any context. It's then up to the caller to make sense of the way that it is used.
If the PKCS#11 URI contains unrecognized URI parts or parts not applicable to the specified context, then the unrecognized flag will be set. This will prevent the URI from matching using the various match functions.
The string to parse
The type of URI that is expected
The blank URI to parse the values into
In PKCS#11 structures many strings are encoded in a strange way. The string is placed in a fixed length buffer and then padded with spaces.
This function copies the space padded string into a normal null-terminated string. The result is owned by the caller.