public AbstractTlsClient() { this(new DefaultTlsCipherFactory()); }
protected TlsBlockCipher createAESCipher(TlsContext context, int cipherKeySize, int macAlgorithm) throws IOException { return new TlsBlockCipher(context, createAESBlockCipher(), createAESBlockCipher(), createHMACDigest(macAlgorithm), createHMACDigest(macAlgorithm), cipherKeySize); }
protected TlsBlockCipher createCamelliaCipher(TlsContext context, int cipherKeySize, int macAlgorithm) throws IOException { return new TlsBlockCipher(context, createCamelliaBlockCipher(), createCamelliaBlockCipher(), createHMACDigest(macAlgorithm), createHMACDigest(macAlgorithm), cipherKeySize); }
return createDESedeCipher(context, macAlgorithm); case EncryptionAlgorithm.AES_128_CBC: return createAESCipher(context, 16, macAlgorithm); case EncryptionAlgorithm.AES_128_CCM: return createCipher_AES_CCM(context, 16, 16); case EncryptionAlgorithm.AES_128_CCM_8: return createCipher_AES_CCM(context, 16, 8); case EncryptionAlgorithm.AES_128_GCM: return createCipher_AES_GCM(context, 16, 16); case EncryptionAlgorithm.AES_128_OCB_TAGLEN96: return createCipher_AES_OCB(context, 16, 12); case EncryptionAlgorithm.AES_256_CBC: return createAESCipher(context, 32, macAlgorithm); case EncryptionAlgorithm.AES_256_CCM: return createCipher_AES_CCM(context, 32, 16); case EncryptionAlgorithm.AES_256_CCM_8: return createCipher_AES_CCM(context, 32, 8); case EncryptionAlgorithm.AES_256_GCM: return createCipher_AES_GCM(context, 32, 16); case EncryptionAlgorithm.AES_256_OCB_TAGLEN96: return createCipher_AES_OCB(context, 32, 12);
protected AEADBlockCipher createAEADBlockCipher_AES_OCB() { return new OCBBlockCipher(createAESEngine(), createAESEngine()); }
protected AEADBlockCipher createAEADBlockCipher_Camellia_GCM() { // TODO Consider allowing custom configuration of multiplier return new GCMBlockCipher(createCamelliaEngine()); }
protected TlsAEADCipher createCipher_Camellia_GCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_Camellia_GCM(), createAEADBlockCipher_Camellia_GCM(), cipherKeySize, macSize); }
protected TlsAEADCipher createCipher_AES_GCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_AES_GCM(), createAEADBlockCipher_AES_GCM(), cipherKeySize, macSize); }
protected TlsAEADCipher createCipher_AES_CCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_AES_CCM(), createAEADBlockCipher_AES_CCM(), cipherKeySize, macSize); }
return createDESedeCipher(context, macAlgorithm); case EncryptionAlgorithm.AEAD_CHACHA20_POLY1305: return createChaCha20Poly1305(context); case EncryptionAlgorithm.AES_128_CBC: return createAESCipher(context, 16, macAlgorithm); case EncryptionAlgorithm.AES_128_CCM: return createCipher_AES_CCM(context, 16, 16); case EncryptionAlgorithm.AES_128_CCM_8: return createCipher_AES_CCM(context, 16, 8); case EncryptionAlgorithm.AES_256_CCM: return createCipher_AES_CCM(context, 32, 16); case EncryptionAlgorithm.AES_256_CCM_8: return createCipher_AES_CCM(context, 32, 8); case EncryptionAlgorithm.AES_128_GCM: return createCipher_AES_GCM(context, 16, 16); case EncryptionAlgorithm.AES_256_CBC: return createAESCipher(context, 32, macAlgorithm); case EncryptionAlgorithm.AES_256_GCM: return createCipher_AES_GCM(context, 32, 16); case EncryptionAlgorithm.CAMELLIA_128_CBC: return createCamelliaCipher(context, 16, macAlgorithm); case EncryptionAlgorithm.CAMELLIA_128_GCM:
protected AEADBlockCipher createAEADBlockCipher_AES_GCM() { // TODO Consider allowing custom configuration of multiplier return new GCMBlockCipher(createAESEngine()); }
protected AEADBlockCipher createAEADBlockCipher_Camellia_GCM() { // TODO Consider allowing custom configuration of multiplier return new GCMBlockCipher(createCamelliaEngine()); }
protected TlsAEADCipher createCipher_Camellia_GCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_Camellia_GCM(), createAEADBlockCipher_Camellia_GCM(), cipherKeySize, macSize); }
protected TlsAEADCipher createCipher_AES_GCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_AES_GCM(), createAEADBlockCipher_AES_GCM(), cipherKeySize, macSize); }
protected TlsAEADCipher createCipher_AES_CCM(TlsContext context, int cipherKeySize, int macSize) throws IOException { return new TlsAEADCipher(context, createAEADBlockCipher_AES_CCM(), createAEADBlockCipher_AES_CCM(), cipherKeySize, macSize); }
public PSKTlsServer(TlsPSKIdentityManager pskIdentityManager) { this(new DefaultTlsCipherFactory(), pskIdentityManager); }
protected TlsBlockCipher createAESCipher(TlsContext context, int cipherKeySize, int macAlgorithm) throws IOException { return new TlsBlockCipher(context, createAESBlockCipher(), createAESBlockCipher(), createHMACDigest(macAlgorithm), createHMACDigest(macAlgorithm), cipherKeySize); }
protected TlsBlockCipher createCamelliaCipher(TlsContext context, int cipherKeySize, int macAlgorithm) throws IOException { return new TlsBlockCipher(context, createCamelliaBlockCipher(), createCamelliaBlockCipher(), createHMACDigest(macAlgorithm), createHMACDigest(macAlgorithm), cipherKeySize); }
protected BlockCipher createAESBlockCipher() { return new CBCBlockCipher(createAESEngine()); }
protected BlockCipher createCamelliaBlockCipher() { return new CBCBlockCipher(createCamelliaEngine()); }