Class (GI Struct)

Secret-1SecretValue

A value containing a secret

A Secret.Value contains a password or other secret value.

Use 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 Secret.Value has a content type. For passwords, this is text/plain. Use Value.get_content_type to look at the content type.

Secret.Value is reference counted and immutable. The secret data is only freed when all references have been released via Value.unref.

Index

Constructors

Properties

$gtype: GType<Secret.Value>

Methods

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

    Returns string

    the content type

  • Unreference a Secret.Value and steal the secret data in Secret.Value as nonpageable memory.

    Parameters

    • length: number

      the length of the secret

    Returns [string, number]

    a new password string stored in nonpageable memory which must be freed with password_free when done