package de.persosim.simulator.protocols.pace;

import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.spec.InvalidKeySpecException;

import de.persosim.simulator.crypto.DomainParameterSet;

/**
 * This interface represents the various mapping functions. They map a given set
 * of domain parameters to new domain parameters (according to PICC and PCD
 * generated mapping data).
 * 
 * @author slutters
 * 
 */
public interface Mapping {

	/**
	 * This method performs the mapping of domain parameters.
	 * 
	 * @param domainParameterSet
	 *            the original set of domain parameters
	 * @param sNonce
	 *            the nonce s as generated by the PICC
	 * @param mappingData
	 *            the mapping data as received from the PCD
	 * @return the {@link MappingResult}
	 */
	public abstract MappingResult performMapping(DomainParameterSet domainParameterSet, byte[] sNonce, byte[] mappingData) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException, InvalidKeySpecException;
	
	/**
	 * This method returns a String describing the meaning of what is expected as mapping data input.
	 * @return a String describing the meaning of what is expected as mapping data input
	 */
	public abstract String getMeaningOfMappingData();
	
	/**
	 * This method returns the name of the mapping.
	 * @return the name of the mapping
	 */
	public abstract String getMappingName();

}
