Interface GnomeKeyringLibrary
-
- All Superinterfaces:
com.sun.jna.Library
public interface GnomeKeyringLibrary 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 classGnomeKeyringLibrary.GnomeKeyringAttributestatic classGnomeKeyringLibrary.GnomeKeyringFoundstatic classGnomeKeyringLibrary.GnomeKeyringPasswordSchemaSchema for secret https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#GnomeKeyringPasswordSchemastatic classGnomeKeyringLibrary.GnomeKeyringPasswordSchemaAttributeItem Attributes — Attributes of individual keyring items.static classGnomeKeyringLibrary.PointerToPointerA pointer to pointer helper structure
-
Field Summary
Fields Modifier and Type Field Description static intGNOME_KEYRING_ATTRIBUTE_SIZEstatic intGNOME_KEYRING_ATTRIBUTE_TYPE_STRINGGnomeKeyringAttributeType: GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32static intGNOME_KEYRING_ATTRIBUTE_TYPE_UINT32static StringGNOME_KEYRING_DEFAULTSave secrets to diskstatic intGNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORDstatic intGNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORDstatic intGNOME_KEYRING_ITEM_GENERIC_SECRETThe item types GNOME_KEYRING_ITEM_GENERIC_SECRET = 0, GNOME_KEYRING_ITEM_NETWORK_PASSWORD, GNOME_KEYRING_ITEM_NOTE, GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD, GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD, GNOME_KEYRING_ITEM_PK_STORAGE = 0x100, Not used, remains here only for compatibility GNOME_KEYRING_ITEM_LAST_TYPE,static intGNOME_KEYRING_ITEM_NETWORK_PASSWORDstatic intGNOME_KEYRING_ITEM_NOTEstatic intGNOME_KEYRING_RESULT_ALREADY_UNLOCKEDstatic intGNOME_KEYRING_RESULT_BAD_ARGUMENTSstatic intGNOME_KEYRING_RESULT_CANCELLEDstatic intGNOME_KEYRING_RESULT_DENIEDstatic intGNOME_KEYRING_RESULT_IO_ERRORstatic intGNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTSstatic intGNOME_KEYRING_RESULT_NO_KEYRING_DAEMONstatic intGNOME_KEYRING_RESULT_NO_MATCHstatic intGNOME_KEYRING_RESULT_NO_SUCH_KEYRINGstatic intGNOME_KEYRING_RESULT_OKGnomeKeyringResult: GNOME_KEYRING_RESULT_OK, GNOME_KEYRING_RESULT_DENIED, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON, GNOME_KEYRING_RESULT_ALREADY_UNLOCKED, GNOME_KEYRING_RESULT_NO_SUCH_KEYRING, GNOME_KEYRING_RESULT_BAD_ARGUMENTS, GNOME_KEYRING_RESULT_IO_ERROR, GNOME_KEYRING_RESULT_CANCELLED, GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS, GNOME_KEYRING_RESULT_NO_MATCHstatic StringGNOME_KEYRING_SESSIONSave secrets in memorystatic GnomeKeyringLibraryINSTANCE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intg_list_length(com.sun.jna.Pointer list)GnomeKeyringLibrary.GnomeKeyringFoundg_list_nth_data(com.sun.jna.Pointer list, int n)voidgnome_keyring_attribute_list_append_string(com.sun.jna.Pointer attributes, String name, String value)voidgnome_keyring_attribute_list_free(com.sun.jna.Pointer attributes)intgnome_keyring_delete_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, Object... args)Delete a stored secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-delete-password-syncintgnome_keyring_find_items_sync(int type, com.sun.jna.Pointer attributes, com.sun.jna.Pointer[] found)intgnome_keyring_find_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, GnomeKeyringLibrary.PointerToPointer password, Object... args)Retrieving a stored secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-find-password-syncvoidgnome_keyring_found_list_free(com.sun.jna.Pointer found_list)voidgnome_keyring_free_password(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-passwordintgnome_keyring_get_info_sync(String keyring, GnomeKeyringLibrary.PointerToPointer keyring_info)Get information about keyring.voidgnome_keyring_info_free(com.sun.jna.Pointer keyring_info)Free the keyring info pointer return by gnome_keyring_get_info_sync If null pointer is passed nothing occurs.booleangnome_keyring_info_get_is_locked(com.sun.jna.Pointer keyring_info)Get whether the keyring is locked or not.Stringgnome_keyring_result_to_message(int errorCode)Translate error code to human readable stringintgnome_keyring_store_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, String keyring, String display_name, String password, Object... args)Storing a secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-store-password-syncintgnome_keyring_unlock_sync(String keyring, String password)Unlock a keyring, so that its contents may be accessed.
-
-
-
Field Detail
-
INSTANCE
static final GnomeKeyringLibrary INSTANCE
-
GNOME_KEYRING_DEFAULT
static final String GNOME_KEYRING_DEFAULT
Save secrets to disk
-
GNOME_KEYRING_SESSION
static final String GNOME_KEYRING_SESSION
Save secrets in memory- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_OK
static final int GNOME_KEYRING_RESULT_OK
GnomeKeyringResult: GNOME_KEYRING_RESULT_OK, GNOME_KEYRING_RESULT_DENIED, GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON, GNOME_KEYRING_RESULT_ALREADY_UNLOCKED, GNOME_KEYRING_RESULT_NO_SUCH_KEYRING, GNOME_KEYRING_RESULT_BAD_ARGUMENTS, GNOME_KEYRING_RESULT_IO_ERROR, GNOME_KEYRING_RESULT_CANCELLED, GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS, GNOME_KEYRING_RESULT_NO_MATCH- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_DENIED
static final int GNOME_KEYRING_RESULT_DENIED
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON
static final int GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_ALREADY_UNLOCKED
static final int GNOME_KEYRING_RESULT_ALREADY_UNLOCKED
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_NO_SUCH_KEYRING
static final int GNOME_KEYRING_RESULT_NO_SUCH_KEYRING
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_BAD_ARGUMENTS
static final int GNOME_KEYRING_RESULT_BAD_ARGUMENTS
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_IO_ERROR
static final int GNOME_KEYRING_RESULT_IO_ERROR
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_CANCELLED
static final int GNOME_KEYRING_RESULT_CANCELLED
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS
static final int GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS
- See Also:
- Constant Field Values
-
GNOME_KEYRING_RESULT_NO_MATCH
static final int GNOME_KEYRING_RESULT_NO_MATCH
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ITEM_GENERIC_SECRET
static final int GNOME_KEYRING_ITEM_GENERIC_SECRET
The item types GNOME_KEYRING_ITEM_GENERIC_SECRET = 0, GNOME_KEYRING_ITEM_NETWORK_PASSWORD, GNOME_KEYRING_ITEM_NOTE, GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD, GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD, GNOME_KEYRING_ITEM_PK_STORAGE = 0x100, Not used, remains here only for compatibility GNOME_KEYRING_ITEM_LAST_TYPE,- See Also:
- Constant Field Values
-
GNOME_KEYRING_ITEM_NETWORK_PASSWORD
static final int GNOME_KEYRING_ITEM_NETWORK_PASSWORD
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ITEM_NOTE
static final int GNOME_KEYRING_ITEM_NOTE
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD
static final int GNOME_KEYRING_ITEM_CHAINED_KEYRING_PASSWORD
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD
static final int GNOME_KEYRING_ITEM_ENCRYPTION_KEY_PASSWORD
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ATTRIBUTE_TYPE_STRING
static final int GNOME_KEYRING_ATTRIBUTE_TYPE_STRING
GnomeKeyringAttributeType: GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32- See Also:
- Constant Field Values
-
GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32
static final int GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32
- See Also:
- Constant Field Values
-
GNOME_KEYRING_ATTRIBUTE_SIZE
static final int GNOME_KEYRING_ATTRIBUTE_SIZE
-
-
Method Detail
-
gnome_keyring_store_password_sync
int gnome_keyring_store_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, String keyring, String display_name, String password, Object... args)
Storing a secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-store-password-sync- Parameters:
schema- schema for the secretkeyring- "session" means in memory;nullfor default on disk storagedisplay_name- display name of this secretpassword- actual passwordargs- varargs, attributes of the secret, please read the API document- Returns:
- return code
-
gnome_keyring_find_password_sync
int gnome_keyring_find_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, GnomeKeyringLibrary.PointerToPointer password, Object... args)
Retrieving a stored secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-find-password-sync- Parameters:
schema- schema for the secretpassword- pointer to pointer of the retrieved secretargs- varargs used to locate the secret- Returns:
- return code
-
gnome_keyring_delete_password_sync
int gnome_keyring_delete_password_sync(GnomeKeyringLibrary.GnomeKeyringPasswordSchema schema, Object... args)
Delete a stored secret, without paraphrasing, please read: https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Simple-Password-Storage.html#gnome-keyring-delete-password-sync- Parameters:
schema- schema for the secretargs- varargs used to locate the secret- Returns:
- return code
-
gnome_keyring_free_password
void gnome_keyring_free_password(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
-
gnome_keyring_get_info_sync
int gnome_keyring_get_info_sync(String keyring, GnomeKeyringLibrary.PointerToPointer keyring_info)
Get information about keyring. The GnomeKeyringInfo structure returned in info must be freed with gnome_keyring_info_free().- Parameters:
keyring- keyring namekeyring_info- pointer to pointer to keyring info- Returns:
- return code
-
gnome_keyring_info_free
void gnome_keyring_info_free(com.sun.jna.Pointer keyring_info)
Free the keyring info pointer return by gnome_keyring_get_info_sync If null pointer is passed nothing occurs.- Parameters:
keyring_info- pointer to keyring_info
-
gnome_keyring_info_get_is_locked
boolean gnome_keyring_info_get_is_locked(com.sun.jna.Pointer keyring_info)
Get whether the keyring is locked or not.- Parameters:
keyring_info- pointer to keyring_info- Returns:
truewhen the keyring is locked;falseotherwise.
-
gnome_keyring_unlock_sync
int gnome_keyring_unlock_sync(String keyring, String password)
Unlock a keyring, so that its contents may be accessed. If password is null, user will be prompted for password to unlock the keyring.- Parameters:
keyring- keyring namepassword- password to unlock. If password is null, user will be prompted.- Returns:
truewhen the keyring is unlocked;falseotherwise.
-
gnome_keyring_result_to_message
String gnome_keyring_result_to_message(int errorCode)
Translate error code to human readable string- Parameters:
errorCode- keyring error code- Returns:
- Error description
-
gnome_keyring_attribute_list_append_string
void gnome_keyring_attribute_list_append_string(com.sun.jna.Pointer attributes, String name, String value)
-
gnome_keyring_attribute_list_free
void gnome_keyring_attribute_list_free(com.sun.jna.Pointer attributes)
-
gnome_keyring_find_items_sync
int gnome_keyring_find_items_sync(int type, com.sun.jna.Pointer attributes, com.sun.jna.Pointer[] found)
-
gnome_keyring_found_list_free
void gnome_keyring_found_list_free(com.sun.jna.Pointer found_list)
-
g_list_length
int g_list_length(com.sun.jna.Pointer list)
-
g_list_nth_data
GnomeKeyringLibrary.GnomeKeyringFound g_list_nth_data(com.sun.jna.Pointer list, int n)
-
-