Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code DEF204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher dans le manuel MySQL

29.3.2 The Keyring Service

MySQL Server supports a keyring service that enables internal server components and plugins to securely store sensitive information for later retrieval. This section describes how to use the keyring service functions to store, retrieve, and remove keys in the MySQL keyring keystore. An SQL interface to the keyring service functions is also available as a set of user-defined functions (UDFs); see Section 6.4.4.8, “General-Purpose Keyring Key-Management Functions”. For general keyring information, see Section 6.4.4, “The MySQL Keyring”.

The keyring service uses whatever underlying keyring plugin is enabled, if any. If no keyring plugin is enabled, keyring service calls fail.

A record in the keystore consists of data (the key itself) and a unique identifier through which the key is accessed. The identifier has two parts:

  • key_id: The key ID or name. key_id values that begin with mysql_ are reserved by MySQL Server.

  • user_id: The session effective user ID. If there is no user context, this value can be NULL. The value need not actually be a user; the meaning depends on the application.

    Functions that implement the keyring UDF interface pass the value of CURRENT_USER() as the user_id value to keyring service functions.

The keyring service functions have these characteristics in common:

  • Each function returns 0 for success, 1 for failure.

  • The key_id and user_id arguments form a unique combination indicating which key in the keyring to use.

  • The key_type argument provides additional information about the key, such as its encryption method or intended use.

  • Keyring service functions treat key IDs, user names, types, and values as binary strings, so comparisons are case sensitive. For example, IDs of MyKey and mykey refer to different keys.

These keyring service functions are available:

  • my_key_fetch()

    Deobfuscates and retrieves a key from the keyring, along with its type. The function allocates the memory for the buffers used to store the returned key and key type. The caller should zero or obfuscate the memory when it is no longer needed, then free it.

    Syntax:

    bool my_key_fetch(const char *key_id, const char **key_type,
                      const char* user_id, void **key, size_t *key_len)

    Arguments:

    • key_id, user_id: Null-terminated strings that as a pair form a unique identifier indicating which key to fetch.

    • key_type: The address of a buffer pointer. The function stores into it a pointer to a null-terminated string that provides additional information about the key (stored when the key was added).

    • key: The address of a buffer pointer. The function stores into it a pointer to the buffer containing the fetched key data.

    • key_len: The address of a variable into which the function stores the size in bytes of the *key buffer.

    Return value:

    Returns 0 for success, 1 for failure.

  • my_key_generate()

    Generates a new random key of a given type and length and stores it in the keyring. The key has a length of key_len and is associated with the identifier formed from key_id and user_id. The type and length values must be consistent with the values supported by the underlying keyring plugin. See Section 6.4.4.7, “Supported Keyring Key Types”.

    Syntax:

    bool my_key_generate(const char *key_id, const char *key_type,
                         const char *user_id, size_t key_len)

    Arguments:

    • key_id, user_id: Null-terminated strings that as a pair form a unique identifier for the key to be generated.

    • key_type: A null-terminated string that provides additional information about the key.

    • key_len: The size in bytes of the key to be generated.

    Return value:

    Returns 0 for success, 1 for failure.

  • my_key_remove()

    Removes a key from the keyring.

    Syntax:

    bool my_key_remove(const char *key_id, const char* user_id)

    Arguments:

    • key_id, user_id: Null-terminated strings that as a pair form a unique identifier for the key to be removed.

    Return value:

    Returns 0 for success, 1 for failure.

  • my_key_store()

    Obfuscates and stores a key in the keyring.

    Syntax:

    bool my_key_store(const char *key_id, const char *key_type,
                      const char* user_id, void *key, size_t key_len)

    Arguments:

    • key_id, user_id: Null-terminated strings that as a pair form a unique identifier for the key to be stored.

    • key_type: A null-terminated string that provides additional information about the key.

    • key: The buffer containing the key data to be stored.

    • key_len: The size in bytes of the key buffer.

    Return value:

    Returns 0 for success, 1 for failure.


Zoek in de MySQL-handleiding

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-keyring-service.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:en Manuel MySQL : https://dev.mysql.com/

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut