// Copyright (C) 2014 jOVAL.org.  All rights reserved.
// This software is licensed under the LGPL 3.0 license available at http://www.gnu.org/licenses/lgpl.txt

package jsaf.intf.discovery;

import jsaf.intf.remote.IConnectionSpecification;
import jsaf.intf.system.ISession;
import jsaf.intf.util.ILoggable;

/**
 * An interface describing discovery-related utilities, useful for discovering connection-related information about
 * remote devices.
 *
 * @author David A. Solin
 * @version %I% %G%
 * @since 1.3
 */
public interface IDiscoveryService extends ILoggable {
    /**
     * Discover the type of an IConnectionSpecification whose type is Type.UNKNOWN.
     */
    Result discover(IConnectionSpecification target) throws Exception;

    /**
     * Decrypt an SSH private key.
     */
    byte[] decryptPrivateKey(byte[] encrypted, byte[] passphrase) throws Exception;

    /**
     * Get the public key fingerprint of an SSH target.
     */
    String getFingerprint(IConnectionSpecification target) throws Exception;

    /**
     * An interface for discovery result information.
     */
    public interface Result {
	/**
	 * Return the session type discovered for the device.
	 */
        ISession.Type getType();

	/**
	 * Return the fingerprint of the SSH public key (if Type is SSH).
	 */
        String getFingerprint();
    }
}

@@ -47,17 +47,16 @@
 eserved.
-%0D
 %0A// This
@@ -153,19 +153,17 @@
 lgpl.txt
-%0D%0A%0D
+%0A
 %0Apackage
@@ -183,19 +183,17 @@
 scovery;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -230,25 +230,24 @@
 ecification;
-%0D
 %0Aimport jsaf
@@ -268,17 +268,16 @@
 Session;
-%0D
 %0Aimport 
@@ -305,16 +305,13 @@
 ble;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -422,17 +422,16 @@
 on about
-%0D
 %0A * remo
@@ -445,13 +445,11 @@
 ces.
-%0D
 %0A *
-%0D
 %0A * 
@@ -470,17 +470,16 @@
 A. Solin
-%0D
 %0A * @ver
@@ -490,17 +490,16 @@
  %25I%25 %25G%25
-%0D
 %0A * @sin
@@ -508,14 +508,12 @@
  1.3
-%0D
 %0A */
-%0D
 %0Apub
@@ -563,25 +563,24 @@
 ggable %7B
-%0D
 %0A    /**
 %0D%0A     *
@@ -563,33 +563,32 @@
 ggable %7B%0A    /**
-%0D
 %0A     * Discover
@@ -655,25 +655,24 @@
 UNKNOWN.
-%0D
 %0A     */
 %0D%0A    Re
@@ -659,25 +659,24 @@
 OWN.%0A     */
-%0D
 %0A    Result 
@@ -730,35 +730,33 @@
 s Exception;
-%0D%0A%0D
+%0A
 %0A    /**
 %0D%0A     * Dec
@@ -735,33 +735,32 @@
 eption;%0A%0A    /**
-%0D
 %0A     * Decrypt 
@@ -778,25 +778,51 @@
 ate key.
-%0D
+%0A     *%0A     * @since 1.3.5
 %0A     */
 %0D%0A    by
@@ -809,25 +809,24 @@
 .3.5%0A     */
-%0D
 %0A    byte%5B%5D 
@@ -861,20 +861,20 @@
 rypted, 
-byte
+char
 %5B%5D passp
@@ -893,35 +893,33 @@
 s Exception;
-%0D%0A%0D
+%0A
 %0A    /**
 %0D%0A     * Get
@@ -898,33 +898,32 @@
 eption;%0A%0A    /**
-%0D
 %0A     * Get the 
@@ -962,25 +962,24 @@
  target.
-%0D
 %0A     */
 %0D%0A    St
@@ -966,25 +966,24 @@
 get.%0A     */
-%0D
 %0A    String 
@@ -1051,19 +1051,17 @@
 ion;
-%0D%0A%0D
+%0A
 %0A    /**
 %0D%0A  
@@ -1056,17 +1056,16 @@
 %0A    /**
-%0D
 %0A     * 
@@ -1114,17 +1114,16 @@
 ion.
-%0D
 %0A     */
 %0D%0A  
@@ -1118,17 +1118,16 @@
 %0A     */
-%0D
 %0A    pub
@@ -1148,23 +1148,21 @@
 Result %7B
-%0D
 %0A%09/**
-%0D
 %0A%09 * Ret
@@ -1208,23 +1208,21 @@
  device.
-%0D
 %0A%09 */
-%0D
 %0A       
@@ -1250,17 +1250,14 @@
 e();
-%0D%0A%0D
+%0A
 %0A%09/**
-%0D
 %0A%09 *
@@ -1323,15 +1323,13 @@
 SH).
-%0D
 %0A%09 */
-%0D
 %0A   
@@ -1361,16 +1361,13 @@
 t();
-%0D
 %0A    %7D
-%0D
 %0A%7D
-%0D
 %0A

Update IDiscoveryService to accept a char[] private key passphrase.