org.keycloak.keys

## Class DefaultKeyManager

- java.lang.Object
- - org.keycloak.keys.DefaultKeyManager

- All Implemented Interfaces:
    KeyManager

      public class DefaultKeyManager
      extends Object
      implements KeyManager

  Author:
    Stian Thorgersen

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.KeyManager

      `KeyManager.ActiveAesKey, KeyManager.ActiveHmacKey, KeyManager.ActiveRsaKey`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultKeyManager(KeycloakSession session)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `KeyManager.ActiveAesKey` | `getActiveAesKey(RealmModel realm)` Deprecated.
    `KeyManager.ActiveHmacKey` | `getActiveHmacKey(RealmModel realm)` Deprecated.
    `KeyWrapper` | `getActiveKey(RealmModel realm, KeyUse use, String algorithm)`
    `KeyManager.ActiveRsaKey` | `getActiveRsaKey(RealmModel realm)` Deprecated.
    `List<SecretKeyMetadata>` | `getAesKeys(RealmModel realm)`
    `SecretKey` | `getAesSecretKey(RealmModel realm, String kid)` Deprecated.
    `List<SecretKeyMetadata>` | `getHmacKeys(RealmModel realm)`
    `SecretKey` | `getHmacSecretKey(RealmModel realm, String kid)` Deprecated.
    `KeyWrapper` | `getKey(RealmModel realm, String kid, KeyUse use, String algorithm)`
    `Stream<KeyWrapper>` | `getKeysStream(RealmModel realm)` Returns all `KeyWrapper` for the given realm.
    `Stream<KeyWrapper>` | `getKeysStream(RealmModel realm, KeyUse use, String algorithm)` Returns all `KeyWrapper` for the given realm that match given criteria.
    `Certificate` | `getRsaCertificate(RealmModel realm, String kid)` Deprecated.
    `List<RsaKeyMetadata>` | `getRsaKeys(RealmModel realm)` Deprecated.
    `PublicKey` | `getRsaPublicKey(RealmModel realm, String kid)` Deprecated.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.KeyManager

      `getKeys, getKeys`

- - ### Constructor Detail

    - #### DefaultKeyManager

          public DefaultKeyManager(KeycloakSession session)

  - ### Method Detail

    - #### getActiveKey

          public KeyWrapper getActiveKey(RealmModel realm,
                                         KeyUse use,
                                         String algorithm)

      Specified by:
        `getActiveKey` in interface `KeyManager`

    - #### getKey

          public KeyWrapper getKey(RealmModel realm,
                                   String kid,
                                   KeyUse use,
                                   String algorithm)

      Specified by:
        `getKey` in interface `KeyManager`

    - #### getKeysStream

          public Stream<KeyWrapper> getKeysStream(RealmModel realm,
                                                  KeyUse use,
                                                  String algorithm)

      Description copied from interface: `KeyManager`
      Returns all `KeyWrapper` for the given realm that match given criteria.
      Specified by:
        `getKeysStream` in interface `KeyManager`
      Parameters:
        `realm` - `RealmModel`.
        `use` - `KeyUse`.
        `algorithm` - `String`.
      Returns:
        Stream of all `KeyWrapper` in the realm.

    - #### getKeysStream

          public Stream<KeyWrapper> getKeysStream(RealmModel realm)

      Description copied from interface: `KeyManager`
      Returns all `KeyWrapper` for the given realm.
      Specified by:
        `getKeysStream` in interface `KeyManager`
      Parameters:
        `realm` - `RealmModel`.
      Returns:
        Stream of all `KeyWrapper` in the realm.

    - #### getActiveRsaKey

          @Deprecated
          public KeyManager.ActiveRsaKey getActiveRsaKey(RealmModel realm)

      Deprecated.
      Specified by:
        `getActiveRsaKey` in interface `KeyManager`

    - #### getActiveHmacKey

          @Deprecated
          public KeyManager.ActiveHmacKey getActiveHmacKey(RealmModel realm)

      Deprecated.
      Specified by:
        `getActiveHmacKey` in interface `KeyManager`

    - #### getActiveAesKey

          @Deprecated
          public KeyManager.ActiveAesKey getActiveAesKey(RealmModel realm)

      Deprecated.
      Specified by:
        `getActiveAesKey` in interface `KeyManager`

    - #### getRsaPublicKey

          @Deprecated
          public PublicKey getRsaPublicKey(RealmModel realm,
                                                       String kid)

      Deprecated.
      Specified by:
        `getRsaPublicKey` in interface `KeyManager`

    - #### getRsaCertificate

          @Deprecated
          public Certificate getRsaCertificate(RealmModel realm,
                                                           String kid)

      Deprecated.
      Specified by:
        `getRsaCertificate` in interface `KeyManager`

    - #### getHmacSecretKey

          @Deprecated
          public SecretKey getHmacSecretKey(RealmModel realm,
                                                        String kid)

      Deprecated.
      Specified by:
        `getHmacSecretKey` in interface `KeyManager`

    - #### getAesSecretKey

          @Deprecated
          public SecretKey getAesSecretKey(RealmModel realm,
                                                       String kid)

      Deprecated.
      Specified by:
        `getAesSecretKey` in interface `KeyManager`

    - #### getRsaKeys

          @Deprecated
          public List<RsaKeyMetadata> getRsaKeys(RealmModel realm)

      Deprecated.
      Specified by:
        `getRsaKeys` in interface `KeyManager`

    - #### getHmacKeys

          public List<SecretKeyMetadata> getHmacKeys(RealmModel realm)

      Specified by:
        `getHmacKeys` in interface `KeyManager`

    - #### getAesKeys

          public List<SecretKeyMetadata> getAesKeys(RealmModel realm)

      Specified by:
        `getAesKeys` in interface `KeyManager`

Copyright © 2021 JBoss by Red Hat. All rights reserved.