/*
 * Class: KeyPairFormat
 *
 * Author: Alex Usun
 *
 * Date: 31/8/2005
 */
package com.jscape.inet.ssh.util.keyreader;

import java.security.KeyPair;

/**
 * Represents key pair format.
 *
 * @author Alex Usun
 * @version 1.0
 * @see <a href="KeyPairFormat.java.html">Source code</a>
 */
public interface KeyPairFormat {

    /**
     * Restores key pair from the specified byte array.
     *
     * @param data       key pair data
     * @param passphrase passphrase
     *
     * @return restored key pair
     *
     * @throws IllegalArgumentException if specified key data is not in corresponded format
     * @throws FormatException          if key pair cannot be restored
     */
    KeyPair restoreKeyPair(byte[] data, String passphrase)
            throws FormatException;
}
