private List<CipherOption> getCipherOptions() throws IOException { // Negotiate cipher suites if configured. Currently, the only supported // cipher suite is AES/CTR/NoPadding, but the protocol allows multiple // values for future expansion. String cipherSuites = conf.get(DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY); if (StringUtils.isBlank(cipherSuites)) { return null; } if (!cipherSuites.equals(CipherSuite.AES_CTR_NOPADDING.getName())) { throw new IOException(String.format("Invalid cipher suite, %s=%s", DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY, cipherSuites)); } return Collections.singletonList(new CipherOption(CipherSuite.AES_CTR_NOPADDING)); }
public OpensslAesCtrCipher(int mode) throws GeneralSecurityException { this.mode = mode; cipher = OpensslCipher.getInstance(SUITE.getName()); }
/** * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for * certain cipher suite, just need to compare the name. * @param name cipher suite name * @return CipherSuite cipher suite */ public static CipherSuite convert(String name) { CipherSuite[] suites = CipherSuite.values(); for (CipherSuite suite : suites) { if (suite.getName().equals(name)) { return suite; } } throw new IllegalArgumentException("Invalid cipher suite name: " + name); }
try { CryptoCodec c = ReflectionUtils.newInstance(klass, conf); if (c.getCipherSuite().getName().equals(cipherSuite.getName())) { if (codec == null) { PerformanceAdvisory.LOG.debug("Using crypto codec {}.", PerformanceAdvisory.LOG.debug( "Crypto codec {} doesn't meet the cipher suite {}.", klass.getName(), cipherSuite.getName());
@Parameters(name = "{index}: protection={0}, encryption={1}, cipherSuite={2}") public static Iterable<Object[]> data() { List<Object[]> params = new ArrayList<>(); for (String protection : Arrays.asList("authentication", "integrity", "privacy")) { for (String encryptionAlgorithm : Arrays.asList("", "3des", "rc4")) { for (String cipherSuite : Arrays.asList("", CipherSuite.AES_CTR_NOPADDING.getName())) { params.add(new Object[] { protection, encryptionAlgorithm, cipherSuite }); } } } return params; }
cipherOption.getCipherSuite().getName(), peer.getRemoteAddressString());
public OpensslAesCtrCipher(int mode) throws GeneralSecurityException { this.mode = mode; cipher = OpensslCipher.getInstance(SUITE.getName()); }
public OpensslAesCtrCipher(int mode) throws GeneralSecurityException { this.mode = mode; cipher = OpensslCipher.getInstance(SUITE.getName()); }
public OpensslAesCtrCipher(int mode) throws GeneralSecurityException { this.mode = mode; cipher = OpensslCipher.getInstance(SUITE.getName()); }
public OpensslAesCtrCipher(int mode) throws GeneralSecurityException { this.mode = mode; cipher = OpensslCipher.getInstance(SUITE.getName()); }
/** * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for * certain cipher suite, just need to compare the name. * @param name cipher suite name * @return CipherSuite cipher suite */ public static CipherSuite convert(String name) { CipherSuite[] suites = CipherSuite.values(); for (CipherSuite suite : suites) { if (suite.getName().equals(name)) { return suite; } } throw new IllegalArgumentException("Invalid cipher suite name: " + name); }
/** * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for * certain cipher suite, just need to compare the name. * @param name cipher suite name * @return CipherSuite cipher suite */ public static CipherSuite convert(String name) { CipherSuite[] suites = CipherSuite.values(); for (CipherSuite suite : suites) { if (suite.getName().equals(name)) { return suite; } } throw new IllegalArgumentException("Invalid cipher suite name: " + name); }
/** * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for * certain cipher suite, just need to compare the name. * @param name cipher suite name * @return CipherSuite cipher suite */ public static CipherSuite convert(String name) { CipherSuite[] suites = CipherSuite.values(); for (CipherSuite suite : suites) { if (suite.getName().equals(name)) { return suite; } } throw new IllegalArgumentException("Invalid cipher suite name: " + name); }
/** * Convert to CipherSuite from name, {@link #algoBlockSize} is fixed for * certain cipher suite, just need to compare the name. * @param name cipher suite name * @return CipherSuite cipher suite */ public static CipherSuite convert(String name) { CipherSuite[] suites = CipherSuite.values(); for (CipherSuite suite : suites) { if (suite.getName().equals(name)) { return suite; } } throw new IllegalArgumentException("Invalid cipher suite name: " + name); }
@Parameters(name = "{index}: protection={0}, encryption={1}, cipherSuite={2}") public static Iterable<Object[]> data() { List<Object[]> params = new ArrayList<>(); for (String protection : Arrays.asList("authentication", "integrity", "privacy")) { for (String encryptionAlgorithm : Arrays.asList("", "3des", "rc4")) { for (String cipherSuite : Arrays.asList("", CipherSuite.AES_CTR_NOPADDING.getName())) { params.add(new Object[] { protection, encryptionAlgorithm, cipherSuite }); } } } return params; }