Interface KeyLocator

  • All Superinterfaces:
    Iterable<Key>
    All Known Implementing Classes:
    CompositeKeyLocator, HardcodedKeyLocator

    public interface KeyLocator
    extends Iterable<Key>
    This interface defines a method for obtaining a security key by ID.

    If the KeyLocator implementor wants to make all its keys available for iteration, it should implement Iterable<T extends Key> interface. The base KeyLocator does not extend this interface to enable KeyLocators that do not support listing their keys.

    Author:
    Hynek Mlnařík
    • Method Detail

      • getKey

        default Key getKey​(Key key)
                    throws KeyManagementException
        Method that checks if the key passed is inside the locator.
        Parameters:
        key - The key to search
        Returns:
        The same key or null if it's not in the locator
        Throws:
        KeyManagementException
      • getKey

        default Key getKey​(KeyInfo info)
                    throws KeyManagementException
        Returns the key in the locator that is represented by the KeyInfo dsig structure. The default implementation just iterates and returns the first KeyName, X509Data or PublicKey that is in the locator.
        Parameters:
        info - The KeyInfo to search
        Returns:
        The key found or null
        Throws:
        KeyManagementException
      • refreshKeyCache

        void refreshKeyCache()
        If this key locator caches keys in any way, forces this cache cleanup and refreshing the keys.