net.java.truecommons.key.spec.KeyManagerMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truecommons-key-spec Show documentation
Show all versions of truecommons-key-spec Show documentation
Specifies a pluggable API for key management.
The newest version!
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truecommons.key.spec;
import java.util.ServiceConfigurationError;
import net.java.truecommons.shed.ImplementationsShouldExtend;
/**
* A map of key classes to key managers.
* When implementing a key manager map, you should extend the
* {@link AbstractKeyManagerMap} class rather than directly implementing this
* interface in order to maintain binary backwards compatibility even if this
* interface is changed.
*
* Implementations must be safe for multi-threading.
*
* @since TrueCommons 2.2
* @author Christian Schlichtherle
*/
@ImplementationsShouldExtend(AbstractKeyManagerMap.class)
public interface KeyManagerMap {
/**
* Returns the key manager for the given secret key class.
*
* This is a pure function - multiple calls must return the same value for
* the same parameter.
*
* @param the type of the keys.
* @param type the class for the key type.
* @return the key manager for the key class.
* @throws ServiceConfigurationError if no appropriate key manager is
* available.
*/
KeyManager manager(Class type);
}