Interface LibSecretLibrary

  • All Superinterfaces:
    com.sun.jna.Library

    public interface LibSecretLibrary
    extends com.sun.jna.Library
    Simple interface to store and retrieve secrets with gnome-keyring https://developer.gnome.org/gnome-keyring/stable/ch01.html
    • Field Detail

      • SECRET_SERVICE_NONE

        static final int SECRET_SERVICE_NONE
        SecretServiceFlags: SECRET_SERVICE_NONE, SECRET_SERVICE_OPEN_SESSION, SECRET_SERVICE_LOAD_COLLECTIONS,
        See Also:
        Constant Field Values
      • SECRET_SERVICE_OPEN_SESSION

        static final int SECRET_SERVICE_OPEN_SESSION
        See Also:
        Constant Field Values
      • SECRET_SERVICE_LOAD_COLLECTIONS

        static final int SECRET_SERVICE_LOAD_COLLECTIONS
        See Also:
        Constant Field Values
      • SECRET_SCHEMA_NONE

        static final int SECRET_SCHEMA_NONE
        SecretSchemaFlags: SECRET_SCHEMA_NONE, SECRET_SCHEMA_DONT_MATCH_NAME
        See Also:
        Constant Field Values
      • SECRET_SCHEMA_DONT_MATCH_NAME

        static final int SECRET_SCHEMA_DONT_MATCH_NAME
        See Also:
        Constant Field Values
      • SECRET_SCHEMA_ATTRIBUTE_STRING

        static final int SECRET_SCHEMA_ATTRIBUTE_STRING
        SecretSchemaAttributeType: SECRET_SCHEMA_ATTRIBUTE_STRING, SECRET_SCHEMA_ATTRIBUTE_INTEGER, SECRET_SCHEMA_ATTRIBUTE_BOOLEAN
        See Also:
        Constant Field Values
      • SECRET_SCHEMA_ATTRIBUTE_INTEGER

        static final int SECRET_SCHEMA_ATTRIBUTE_INTEGER
        See Also:
        Constant Field Values
      • SECRET_SCHEMA_ATTRIBUTE_BOOLEAN

        static final int SECRET_SCHEMA_ATTRIBUTE_BOOLEAN
        See Also:
        Constant Field Values
      • SECRET_COLLECTION_NONE

        static final int SECRET_COLLECTION_NONE
        SecretCollectionFlags: SECRET_COLLECTION_NONE SECRET_COLLECTION_LOAD_ITEMS
        See Also:
        Constant Field Values
      • SECRET_COLLECTION_LOAD_ITEMS

        static final int SECRET_COLLECTION_LOAD_ITEMS
        See Also:
        Constant Field Values
      • SECRET_SEARCH_NONE

        static final int SECRET_SEARCH_NONE
        SecretSearchFlags: SECRET_SEARCH_NONE, SECRET_SEARCH_ALL, SECRET_SEARCH_UNLOCK, SECRET_SEARCH_LOAD_SECRETS
        See Also:
        Constant Field Values
      • SECRET_SEARCH_LOAD_SECRETS

        static final int SECRET_SEARCH_LOAD_SECRETS
        See Also:
        Constant Field Values
    • Method Detail

      • secret_password_store_sync

        boolean secret_password_store_sync​(LibSecretLibrary.SecretSchema schema,
                                           String collection,
                                           String label,
                                           String password,
                                           com.sun.jna.Pointer cancellable,
                                           com.sun.jna.ptr.PointerByReference error,
                                           Object... args)
        Storing a secret, without paraphrasing, please read: https://www.manpagez.com/html/libsecret-1/libsecret-1-0.18.6/libsecret-Password-storage.php#secret_password_lookup_sync
        Parameters:
        schema - schema for the secret
        collection - a collection alias
        label - label for the secret
        password - the password to store
        cancellable - cancellation object
        error - location to place an error on failure
        args - varargs, attributes of the secret, please read the API document
        Returns:
        return code
      • secret_password_lookup_sync

        com.sun.jna.Pointer secret_password_lookup_sync​(LibSecretLibrary.SecretSchema schema,
                                                        com.sun.jna.Pointer cancellable,
                                                        com.sun.jna.ptr.PointerByReference error,
                                                        Object... args)
        Retrieving a stored secret, without paraphrasing, please read: https://www.manpagez.com/html/libsecret-1/libsecret-1-0.18.6/libsecret-Password-storage.php#secret_password_lookup_sync
        Parameters:
        schema - schema for the secret
        cancellable - cancellation object
        error - location to place an error on failure
        args - varargs, attributes of the secret, please read the API document
        Returns:
        return code
      • secret_password_clear_sync

        boolean secret_password_clear_sync​(LibSecretLibrary.SecretSchema schema,
                                           com.sun.jna.Pointer cancellable,
                                           com.sun.jna.ptr.PointerByReference error,
                                           Object... args)
        Delete a stored secret, without paraphrasing, please read: https://www.manpagez.com/html/libsecret-1/libsecret-1-0.18.6/libsecret-Password-storage.php#secret-password-clear-sync
        Parameters:
        schema - schema for the secret
        cancellable - cancellation object
        error - location to place an error on failure
        args - varargs, attributes of the secret, please read the API document
        Returns:
        return code
      • secret_service_search_sync

        com.sun.jna.Pointer secret_service_search_sync​(com.sun.jna.Pointer secret_service,
                                                       LibSecretLibrary.SecretSchema schema,
                                                       com.sun.jna.Pointer attributes,
                                                       int flags,
                                                       com.sun.jna.Pointer cancellable,
                                                       com.sun.jna.ptr.PointerByReference error)
        Search for items matching the attributes. http://www.manpagez.com/html/libsecret-1/libsecret-1-0.18.6/SecretService.php#secret-service-search-sync
        Parameters:
        secret_service - the secret service
        schema - schema for the secret
        attributes - search for items matching these attributes
        flags - search option flags
        cancellable - cancellation object
        error - location to place an error on failure
        Returns:
        a list of items that matched the search
      • secret_service_get_sync

        com.sun.jna.Pointer secret_service_get_sync​(int flags,
                                                    com.sun.jna.Pointer cancellable,
                                                    com.sun.jna.ptr.PointerByReference error)
      • secret_collection_for_alias_sync

        com.sun.jna.Pointer secret_collection_for_alias_sync​(com.sun.jna.Pointer secret_service,
                                                             String alias,
                                                             int flags,
                                                             com.sun.jna.Pointer cancellable,
                                                             com.sun.jna.ptr.PointerByReference error)
      • secret_item_get_attributes

        com.sun.jna.Pointer secret_item_get_attributes​(com.sun.jna.Pointer secretItem)
      • secret_item_get_secret

        com.sun.jna.Pointer secret_item_get_secret​(com.sun.jna.Pointer secretItem)
      • secret_value_get_text

        String secret_value_get_text​(com.sun.jna.Pointer secretValue)
      • secret_value_unref

        void secret_value_unref​(com.sun.jna.Pointer secretValue)
      • secret_password_free

        void secret_password_free​(com.sun.jna.Pointer password)
        Free the in memory secret pointer, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-free-password
        Parameters:
        password - pointer to the secret to be freed
      • secret_collection_get_locked

        boolean secret_collection_get_locked​(com.sun.jna.Pointer secret_collection)
        Get whether the collection is locked or not.
        Parameters:
        secret_collection - pointer to the collection
        Returns:
        true when the keyring is locked; false otherwise.
      • secret_service_unlock_sync

        int secret_service_unlock_sync​(com.sun.jna.Pointer secret_service,
                                       com.sun.jna.Pointer objects,
                                       com.sun.jna.Pointer cancellable,
                                       com.sun.jna.ptr.PointerByReference unlocked,
                                       com.sun.jna.ptr.PointerByReference error)
        Unlock a collection, so that its contents may be accessed. If password is null, user will be prompted for password to unlock the keyring.
        Parameters:
        secret_service - pointer to the secret service
        objects - the items or collections to unlock.
        cancellable - cancellation object
        unlocked - location to place list of items or collections that were unlocked
        error - location to place an error on failure
        Returns:
        true when the keyring is unlocked; false otherwise.
      • g_object_unref

        void g_object_unref​(com.sun.jna.Pointer object)