Interface LibSecretLibrary
-
- All Superinterfaces:
com.sun.jna.Library
public interface LibSecretLibrary extends com.sun.jna.LibrarySimple interface to store and retrieve secrets with gnome-keyring https://developer.gnome.org/gnome-keyring/stable/ch01.html
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLibSecretLibrary.GErrorA error object.static classLibSecretLibrary.SecretSchemaSchema for secret https://www.manpagez.com/html/libsecret-1/libsecret-1-0.18.6/libsecret-SecretSchema.php#SecretSchemastatic classLibSecretLibrary.SecretSchemaAttributeItem Attributes — Attributes of individual keyring items.
-
Field Summary
Fields Modifier and Type Field Description static LibSecretLibraryINSTANCEstatic StringSECRET_COLLECTION_DEFAULTSave secrets to diskstatic intSECRET_COLLECTION_LOAD_ITEMSstatic intSECRET_COLLECTION_NONESecretCollectionFlags: SECRET_COLLECTION_NONE SECRET_COLLECTION_LOAD_ITEMSstatic StringSECRET_COLLECTION_SESSIONSave secrets in memorystatic intSECRET_SCHEMA_ATTRIBUTE_BOOLEANstatic intSECRET_SCHEMA_ATTRIBUTE_INTEGERstatic intSECRET_SCHEMA_ATTRIBUTE_STRINGSecretSchemaAttributeType: SECRET_SCHEMA_ATTRIBUTE_STRING, SECRET_SCHEMA_ATTRIBUTE_INTEGER, SECRET_SCHEMA_ATTRIBUTE_BOOLEANstatic intSECRET_SCHEMA_DONT_MATCH_NAMEstatic intSECRET_SCHEMA_NONESecretSchemaFlags: SECRET_SCHEMA_NONE, SECRET_SCHEMA_DONT_MATCH_NAMEstatic intSECRET_SEARCH_ALLstatic intSECRET_SEARCH_LOAD_SECRETSstatic intSECRET_SEARCH_NONESecretSearchFlags: SECRET_SEARCH_NONE, SECRET_SEARCH_ALL, SECRET_SEARCH_UNLOCK, SECRET_SEARCH_LOAD_SECRETSstatic intSECRET_SEARCH_UNLOCKstatic intSECRET_SERVICE_LOAD_COLLECTIONSstatic intSECRET_SERVICE_NONESecretServiceFlags: SECRET_SERVICE_NONE, SECRET_SERVICE_OPEN_SESSION, SECRET_SERVICE_LOAD_COLLECTIONS,static intSECRET_SERVICE_OPEN_SESSION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidg_object_unref(com.sun.jna.Pointer object)com.sun.jna.Pointersecret_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)booleansecret_collection_get_locked(com.sun.jna.Pointer secret_collection)Get whether the collection is locked or not.com.sun.jna.Pointersecret_item_get_attributes(com.sun.jna.Pointer secretItem)com.sun.jna.Pointersecret_item_get_secret(com.sun.jna.Pointer secretItem)booleansecret_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-syncvoidsecret_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-passwordcom.sun.jna.Pointersecret_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_syncbooleansecret_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_synccom.sun.jna.Pointersecret_service_get_sync(int flags, com.sun.jna.Pointer cancellable, com.sun.jna.ptr.PointerByReference error)com.sun.jna.Pointersecret_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.intsecret_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.Stringsecret_value_get_text(com.sun.jna.Pointer secretValue)voidsecret_value_unref(com.sun.jna.Pointer secretValue)
-
-
-
Field Detail
-
INSTANCE
static final LibSecretLibrary INSTANCE
-
SECRET_COLLECTION_DEFAULT
static final String SECRET_COLLECTION_DEFAULT
Save secrets to disk- See Also:
- Constant Field Values
-
SECRET_COLLECTION_SESSION
static final String SECRET_COLLECTION_SESSION
Save secrets in memory- See Also:
- Constant Field Values
-
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_ALL
static final int SECRET_SEARCH_ALL
- See Also:
- Constant Field Values
-
SECRET_SEARCH_UNLOCK
static final int SECRET_SEARCH_UNLOCK
- 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 secretcollection- a collection aliaslabel- label for the secretpassword- the password to storecancellable- cancellation objecterror- location to place an error on failureargs- 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 secretcancellable- cancellation objecterror- location to place an error on failureargs- 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 secretcancellable- cancellation objecterror- location to place an error on failureargs- 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 serviceschema- schema for the secretattributes- search for items matching these attributesflags- search option flagscancellable- cancellation objecterror- 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:
truewhen the keyring is locked;falseotherwise.
-
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 serviceobjects- the items or collections to unlock.cancellable- cancellation objectunlocked- location to place list of items or collections that were unlockederror- location to place an error on failure- Returns:
truewhen the keyring is unlocked;falseotherwise.
-
g_object_unref
void g_object_unref(com.sun.jna.Pointer object)
-
-