/**
 * 2007(C) jarwyp@icm.edu.pl
 *
 * project: DRIVER
 * module : AAS
 * package:	eu.dnetlib.enabling.aas.ctx.tools
 * file:	ICtxRecoder.java
 * date:    2007-02-20
 */
package eu.dnetlib.enabling.aas.ctx.tools;



/**
 * Encodes and decodes secCtxId from the secCtxIdChain.
 * @author talen
 *
 */
public interface ICtxRecoder {
	
	public static final String VERSION_CHAIN_DELIMITER = "#";
	
	/**
	 * Encodes secCtxId into currentChain given as parameter.
	 * @param ctx
	 * @param currentChain
	 * @param otherPubKey
	 * @return encoded chain of secCtxIds
	 */
	public String encode(CodingContext ctx, String currentChain,
			byte[] otherPubKey);
	
	/**
	 * Decodes secCtxId from currentChain given as parameter.
	 * @param ctx
	 * @param currentChain
	 * @param otherPubKey
	 * @return DecodingResponse
	 */
	public DecodingResponse decode(CodingContext ctx,
			String currentChain, byte[] otherPubKey);
	
	/**
	 * Identifies recoder version.
	 * @return recoder version
	 */
	public String identify();
	
	/**
	 * Appends version prefix to the secCtxChain.
	 * @param secCtxChain
	 * @return secCtxChain enriched with version prefix
	 */
	public String appendVersionPrefix(String secCtxChain);
}
