agave-common/common-core/src/main/java/org/iplantc/service/common/auth/AgaveMyProxyLogon.java
/**
	 * Provides a simple command-line interface.
	 */
Provides a simple command-line interface.
Provides a simple command - line interface .
public static void main(String[] args) {
		try {
			AgaveMyProxyLogon m;
			m = new AgaveMyProxyLogon("myproxy.teragrid.org", DEFAULT_PORT);
			String passphrase;
			m.setUsername("xxx");
			System.out.println("Warning: terminal will echo passphrase as you type.");
			System.out.print("MyProxy Passphrase: ");
			passphrase = readLine(System.in);
			if (passphrase == null) {
				System.err.println("Error reading passphrase.");
				System.exit(1);
			}
			m.setPassphrase(passphrase);
			m.requestTrustRoots(true);
			GSSCredential proxy = m.getCredentials();
			m.writeProxyFile();
			if (proxy == null)
				throw new MyProxyGatewayException("No proxy retrieved");
			if (! new File(m.getTrustRootPath()).exists())
				throw new MyProxyGatewayException("Trusted CA folder was not created");
			String[] trustRootPaths = new File(m.getTrustRootPath()).list();
			if (trustRootPaths == null || trustRootPaths.length == 0 )
				throw new MyProxyGatewayException("Trusted CA folder is empty");
		} catch (Exception e) {
			e.printStackTrace(System.err);
		}
	}
public static void main ( String [ ] args ) { try { AgaveMyProxyLogon m ; m = new AgaveMyProxyLogon ( "myproxy.teragrid.org" , DEFAULT_PORT ) ; String passphrase ; m . setUsername ( "xxx" ) ; System . out . println ( "Warning: terminal will echo passphrase as you type." ) ; System . out . print ( "MyProxy Passphrase: " ) ; passphrase = readLine ( System . in ) ; if ( passphrase == null ) { System . err . println ( "Error reading passphrase." ) ; System . exit ( 1 ) ; } m . setPassphrase ( passphrase ) ; m . requestTrustRoots ( true ) ; GSSCredential proxy = m . getCredentials ( ) ; m . writeProxyFile ( ) ; if ( proxy == null ) throw new MyProxyGatewayException ( "No proxy retrieved" ) ; if ( ! new File ( m . getTrustRootPath ( ) ) . exists ( ) ) throw new MyProxyGatewayException ( "Trusted CA folder was not created" ) ; String [ ] trustRootPaths = new File ( m . getTrustRootPath ( ) ) . list ( ) ; if ( trustRootPaths == null || trustRootPaths . length == 0 ) throw new MyProxyGatewayException ( "Trusted CA folder is empty" ) ; } catch ( Exception e ) { e . printStackTrace ( System . err ) ; } }
Provides a simple command-line interface.
Provides a simple command - line interface .
// Console cons = System.console();