Package org.vngx.jsch.userauth

Examples of org.vngx.jsch.userauth.Identity


      byte[] blob = _readBuffer.getString();
      byte[] data = _readBuffer.getString();
      @SuppressWarnings("unused")
      int flags = _readBuffer.getInt();

      Identity identity = null;
      synchronized ( identities ) {
        for( Identity _identity : identities ) {
          if( _identity.getPublicKeyBlob() == null ) {
            continue;
          }
          if( !Arrays.equals(blob, _identity.getPublicKeyBlob()) ) {
            continue;
          }
          if( _identity.isEncrypted() ) {
            if( userinfo == null ) {
              continue;
            }
            while( _identity.isEncrypted() ) {
              if( !userinfo.promptPassphrase(String.format(MessageConstants.PROMPT_PASSPHRASE, _identity.getName())) ) {
                break;
              }
              String _passphrase = userinfo.getPassphrase();
              if( _passphrase == null ) {
                break;
              }

              byte[] passphrase = Util.str2byte(_passphrase);
              try {
                if( _identity.setPassphrase(passphrase) ) {
                  break;
                }
              } catch(JSchException e) {
                break;
              }
            }
          }

          if( !_identity.isEncrypted() ) {
            identity = _identity;
            break;
          }
        }
      }

      byte[] signature = null;
      if( identity != null ) {
        signature = identity.getSignature(data);
      }

      _messageBuffer.reset();
      if( signature == null ) {
        _messageBuffer.putByte(SSH2_AGENT_FAILURE);
View Full Code Here

TOP

Related Classes of org.vngx.jsch.userauth.Identity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.