Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.crypto.tls;
  
  
  
  public class PSKTlsServer
      extends AbstractTlsServer
 {
 
     public PSKTlsServer(TlsPSKIdentityManager pskIdentityManager)
     {
         this(new DefaultTlsCipherFactory(), pskIdentityManager);
     }
 
     public PSKTlsServer(TlsCipherFactory cipherFactoryTlsPSKIdentityManager pskIdentityManager)
     {
         super(cipherFactory);
         this. = pskIdentityManager;
     }
 
     {
         throw new TlsFatalAlert(.);
     }
 
     protected DHParameters getDHParameters()
     {
         return .;
     }
 
     protected int[] getCipherSuites()
     {
         return new int[]
         {
         };
     }
 
     public TlsCredentials getCredentials() throws IOException
     {
         switch ()
         {
         case .:
 
 
         case .:
         case .:
         case .:
         case .:
         case .:
         case .:
         case .:
         case .:
         case .:
             return null;
 
            return getRSAEncryptionCredentials();
        default:
            /* Note: internal error here; selected a key exchange we don't implement! */
            throw new TlsFatalAlert(.);
        }
    }
    public TlsKeyExchange getKeyExchange() throws IOException
    {
        switch ()
        {
            return createPSKKeyExchange(.);
            return createPSKKeyExchange(.);
        case .:
            return createPSKKeyExchange(.);
            return createPSKKeyExchange(.);
        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 ()
        {
        case .:
        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 createPSKKeyExchange(int keyExchange)
    {
        return new TlsPSKKeyExchange(keyExchangenull,
    }
New to GrepCode? Check out our FAQ X