### Struct

# Secret Value

#### Description [src]

    struct SecretValue {
      /* No available fields */
    }

A value containing a secret

A `SecretValue` contains a password or other secret value.

Use `secret_value_get()` to get the actual secret data, such as a password. The secret data is not necessarily null-terminated, unless the content type is “text/plain”.

Each `SecretValue` has a content type. For passwords, this is `text/plain`. Use `secret_value_get_content_type()` to look at the content type.

`SecretValue` is reference counted and immutable. The secret data is only freed when all references have been released via `secret_value_unref()`.

Stability: Stable

#### Constructors

###### secret_value_new

Create a `SecretValue` for the secret data passed in.

###### secret_value_new_full

Create a `SecretValue` for the secret data passed in.

#### Instance methods

###### secret_value_get

Get the secret data in the `SecretValue`.

###### secret_value_get_content_type

Get the content type of the secret value, such as `text/plain`.

###### secret_value_get_text

Get the secret data in the `SecretValue` if it contains a textual value.

###### secret_value_ref

Add another reference to the `SecretValue`.

###### secret_value_unref

Unreference a `SecretValue`.

###### secret_value_unref_to_password

Unreference a `SecretValue` and steal the secret data in `SecretValue` as nonpageable memory.

since: 0.19.0