package com.jscape.inet.ssh.util.keyreader;

import java.security.Key;
import java.security.NoSuchAlgorithmException;

/**
 * Cipher key and IV factory.
 *
 * @author Alex
 * @version 1.0
 * @see <a href="KeyFactory.java.html">Source code</a>
 */
public interface IKeyFactory {

    /**
     * Creates a new key.
     *
     * @param algorithm algorithm
     * @param size      key size
     *
     * @return a new key instance
     *
     * @throws NoSuchAlgorithmException if algorithm is not supported
     */
    Key createKey(String algorithm, int size)
            throws NoSuchAlgorithmException;

    /**
     * Creates a new IV.
     *
     * @param size IV size
     *
     * @return a new IV
     */
    byte[] createIv(int size);

}
