### Function

# Gck string_from_chars

since: 2

#### Declaration [src]

    gchar*
    gck_string_from_chars (
      const guchar* data,
      gsize max
    )

#### Description [src]

Create a string from a set of PKCS#11 characters. This is similar to `g_strndup()`, except for that it also strips trailing spaces. These space padded strings are often used in PKCS#11 structures.

If the space padded string is filled with null characters then this function will return `NULL`.

Available since: 2

This function is not directly available to language bindings.

#### Parameters

`data`

  Type: `const guchar*`

  The character data to turn into a null terminated string.

  The data is owned by the caller of the function.

`max`

  Type: `gsize`

  The maximum length of the charater data.

#### Return value

Type: `gchar*`

The null terminated string.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.