Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.crypto.tls;
  
  
  
  public class SRPTlsClient
      extends AbstractTlsClient
 {
     protected TlsSRPGroupVerifier groupVerifier;
 
     protected byte[] identity;
     protected byte[] password;
 
     public SRPTlsClient(byte[] identitybyte[] password)
     {
         this(new DefaultTlsCipherFactory(), new DefaultTlsSRPGroupVerifier(), identitypassword);
     }
 
     public SRPTlsClient(TlsCipherFactory cipherFactorybyte[] identitybyte[] password)
     {
         this(cipherFactorynew DefaultTlsSRPGroupVerifier(), identitypassword);
     }
 
     public SRPTlsClient(TlsCipherFactory cipherFactoryTlsSRPGroupVerifier groupVerifier,
         byte[] identitybyte[] password)
     {
         super(cipherFactory);
         this. = groupVerifier;
         this. = Arrays.clone(identity);
         this. = Arrays.clone(password);
     }
 
     protected boolean requireSRPServerExtension()
     {
         // No explicit guidance in RFC 5054; by default an (empty) extension from server is optional
         return false;
     }
 
     public int[] getCipherSuites()
     {
         return new int[]
         {
         };
     }
 
     public Hashtable getClientExtensions()
         throws IOException
     {
         Hashtable clientExtensions = TlsExtensionsUtils.ensureExtensionsInitialised(super.getClientExtensions());
         TlsSRPUtils.addSRPExtension(clientExtensionsthis.);
         return clientExtensions;
     }
 
     public void processServerExtensions(Hashtable serverExtensions)
         throws IOException
     {
         if (!TlsUtils.hasExpectedEmptyExtensionData(serverExtensions.,
             .))
         {
             if (requireSRPServerExtension())
             {
                 throw new TlsFatalAlert(.);
             }
         }
 
         super.processServerExtensions(serverExtensions);
     }
 
     public TlsKeyExchange getKeyExchange()
         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(.);
         }
    }
    {
        /*
         * Note: This method is not called unless a server certificate is sent, which may be the
         * case e.g. for SRP_DSS or SRP_RSA key exchange.
         */
        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