Can't find vendor error for a supported cipher suite

"TLS_RSA_WITH_AES_128_CBC_SHA256" cipher suite is supported by java 8 vendors by default. Ref - https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider .

Also I have the following program to test this. But when I try to get the cipher for the same algorithm, it gives an error.

import java.security.NoSuchAlgorithmException;

import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;

public class CipherSuitesInfoGenerator {

  public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException {

    SSLContext context = SSLContext.getDefault();
    SSLSocketFactory sf = context.getSocketFactory();
    String[] cipherSuites = sf.getSupportedCipherSuites();

    String cipherName = "TLS_RSA_WITH_AES_128_CBC_SHA256";

    for (String s : cipherSuites) {
      if (s.equals(cipherName)) {
        System.out.println(cipherName + " is supported");

        try {
          Cipher cipher = Cipher.getInstance(cipherName);
        } catch (Exception e) {
          System.out.println(e.getMessage());
        }

        break;
      }

    }
  }
}

      

Output:

TLS_RSA_WITH_AES_128_CBC_SHA256 is supported
Cannot find any provider supporting TLS_RSA_WITH_AES_128_CBC_SHA256

      

+3


source to share


1 answer


Ciphersuite is what is used internally by the JSSE provider, it defines the primitives used in the TLS protocol. It is not an instance Cipher

, but Cipher

in Java it is a single primitive used for encryption / decryption like AES or RSA.



+3


source







All Articles