Utilities

Utilities — PKCS#11 utilities

Synopsis

const char *        p11_kit_strerror                    (CK_RV rv);
char *              p11_kit_space_strdup                (const unsigned char *string,
                                                         size_t max_length);
size_t              p11_kit_space_strlen                (const unsigned char *string,
                                                         size_t max_length);

Description

Utility functions for working with PKCS#11.

Details

p11_kit_strerror ()

const char *        p11_kit_strerror                    (CK_RV rv);

Get a message for a PKCS#11 return value or error code. Do not pass CKR_OK or other such non errors to this function.

rv :

The code to get a message for.

Returns :

The user readable and localized message.

p11_kit_space_strdup ()

char *              p11_kit_space_strdup                (const unsigned char *string,
                                                         size_t max_length);

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.

1
2
3
4
5
6
7