Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.crypto.tls;
  
  
  public class SRPTlsServer
      extends AbstractTlsServer
  {
 
     protected byte[] srpIdentity = null;
     protected TlsSRPLoginParameters loginParameters = null;
 
     public SRPTlsServer(TlsSRPIdentityManager srpIdentityManager)
     {
         this(new DefaultTlsCipherFactory(), srpIdentityManager);
     }
 
     public SRPTlsServer(TlsCipherFactory cipherFactoryTlsSRPIdentityManager srpIdentityManager)
     {
         super(cipherFactory);
         this. = srpIdentityManager;
     }
 
         throws IOException
     {
         throw new TlsFatalAlert(.);
     }
 
         throws IOException
     {
         throw new TlsFatalAlert(.);
     }
 
     protected int[] getCipherSuites()
     {
         return new int[]
         {
         };
     }
 
     public void processClientExtensions(Hashtable clientExtensionsthrows IOException
     {
         super.processClientExtensions(clientExtensions);
 
         this. = TlsSRPUtils.getSRPExtension(clientExtensions);
     }
 
     public int getSelectedCipherSuite() throws IOException
     {
         int cipherSuite = super.getSelectedCipherSuite();
 
         if (TlsSRPUtils.isSRPCipherSuite(cipherSuite))
         {
             if ( != null)
             {
                 this. = .getLoginParameters();
             }
 
             if ( == null)
             {
                 throw new TlsFatalAlert(.);
             }
         }
 
         return cipherSuite;
     }
 
     public TlsCredentials getCredentials() throws IOException
     {
         switch ()
         {
             return null;
 
             return getDSASignerCredentials();
 
             return getRSASignerCredentials();
 
         default:
             /* Note: internal error here; selected a key exchange we don't implement! */
             throw new TlsFatalAlert(.);
         }
    }
        throws IOException
    {
        switch ()
        {
            return createSRPKeyExchange(.);
            return createSRPKeyExchange(.);
            return createSRPKeyExchange(.);
        default:
            /*
             * Note: internal error here; the TlsProtocol implementation verifies that the
             * server-selected cipher suite was in the list of client-offered cipher suites, so if
             * we now can't produce an implementation, we shouldn't have offered it!
             */
            throw new TlsFatalAlert(.);
        }
    }
    public TlsCipher getCipher()
        throws IOException
    {
        switch ()
        {
        default:
            /*
             * Note: internal error here; the TlsProtocol implementation verifies that the
             * server-selected cipher suite was in the list of client-offered cipher suites, so if
             * we now can't produce an implementation, we shouldn't have offered it!
             */
            throw new TlsFatalAlert(.);
        }
    }
    protected TlsKeyExchange createSRPKeyExchange(int keyExchange)
    {
        return new TlsSRPKeyExchange(keyExchange);
    }
New to GrepCode? Check out our FAQ X