strolch/src/ch/eitchnet/privilege/handler/EncryptionHandler.java

49 lines
1.1 KiB
Java
Raw Normal View History

2010-05-25 21:41:34 +02:00
/*
* Copyright (c) 2010
*
* Robert von Burg
* eitch@eitchnet.ch
*
* All rights reserved.
*
*/
package ch.eitchnet.privilege.handler;
2010-09-18 22:00:20 +02:00
import java.util.Map;
2010-05-25 23:15:35 +02:00
2010-05-25 21:41:34 +02:00
/**
2010-09-19 20:57:23 +02:00
* The {@link EncryptionHandler} exposes API which is used to handle encrypting of strings, or returning secure tokens
* for certificates and so forth
*
2010-05-25 21:41:34 +02:00
* @author rvonburg
*
*/
2010-08-08 22:13:36 +02:00
public interface EncryptionHandler {
2010-05-25 21:41:34 +02:00
2010-09-18 22:00:20 +02:00
/**
2010-09-19 20:57:23 +02:00
* Calculates or generates a token which can be used to identify certificates and so forth
*
* @return the secure token
2010-09-18 22:00:20 +02:00
*/
2010-05-25 21:41:34 +02:00
public String nextToken();
2010-09-18 22:00:20 +02:00
/**
2010-09-19 20:57:23 +02:00
* Converts a given string, e.g. a password to a hash which is defined by the concrete implementation
*
2010-09-18 22:00:20 +02:00
* @param string
2010-09-19 20:57:23 +02:00
* the string to convert
* @return the hash of the string after converting
2010-09-18 22:00:20 +02:00
*/
2010-05-25 21:41:34 +02:00
public String convertToHash(String string);
2010-08-08 22:13:36 +02:00
2010-09-18 22:00:20 +02:00
/**
2010-09-19 22:19:38 +02:00
* Initialize the concrete {@link EncryptionHandler}. The passed parameter map contains any configuration the
* concrete {@link EncryptionHandler} might need
2010-09-19 20:57:23 +02:00
*
2010-09-18 22:00:20 +02:00
* @param parameterMap
2010-09-19 20:57:23 +02:00
* a map containing configuration properties
2010-09-18 22:00:20 +02:00
*/
public void initialize(Map<String, String> parameterMap);
2010-05-25 21:41:34 +02:00
}