Class KeyNoteUtils

java.lang.Object
org.keycloak.keys.KeyNoteUtils

public class KeyNoteUtils extends Object
Author:
rmartinc
  • Method Details

    • attachKeyNotes

      public static void attachKeyNotes(ComponentModel model, String name, KeyWrapper key)
      Creates two notes in the model to save the key in the cached model. The first note name is the key itself. The second note is the date the certificate expires name.notAfter, if there is a certificate defined in the key (second note can be missing).
      Parameters:
      model - The model component to attach the notes
      name - The name of the note
      key - The key to attach
    • retrieveKeyFromNotes

      public static KeyWrapper retrieveKeyFromNotes(ComponentModel model, String name)
      Retrieves the key from the note in the model if available. The second key for expiration date is also checked to see if the certificate is expired. If expired the key is transformed into passive.
      Parameters:
      model - The model with the keys
      name - The name of the key
      Returns:
      The attached key or null