Rename to Impl since no other ciphers left

This commit is contained in:
Julian Raufelder 2021-04-07 17:16:24 +02:00
parent 3fef796546
commit 18d7c9c218
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
4 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ public class BiometricAuthCryptor {
}
public String decrypt(javax.crypto.Cipher cipher, String password) throws IllegalBlockSizeException, BadPaddingException {
byte[] ciphered = cipher.doFinal(CipherFromApi23.getBytes(password.getBytes(ISO_8859_1)));
byte[] ciphered = cipher.doFinal(CipherImpl.getBytes(password.getBytes(ISO_8859_1)));
return new String(ciphered, UTF_8);
}
}

View File

@ -8,14 +8,14 @@ import javax.crypto.spec.IvParameterSpec;
import static java.lang.System.arraycopy;
class CipherFromApi23 implements Cipher {
class CipherImpl implements Cipher {
private static final int IV_LENGTH = 16;
private final javax.crypto.Cipher cipher;
private final SecretKey key;
CipherFromApi23(javax.crypto.Cipher cipher, SecretKey key) {
CipherImpl(javax.crypto.Cipher cipher, SecretKey key) {
this.cipher = cipher;
this.key = key;
}

View File

@ -16,7 +16,7 @@ class CryptoOperationsFactory {
}
private static CryptoOperations createCryptoOperations() {
return new CryptoOperationsFromApi23();
return new CryptoOperationsImpl();
}
}

View File

@ -10,7 +10,7 @@ import java.security.UnrecoverableKeyException;
import javax.crypto.SecretKey;
class CryptoOperationsFromApi23 implements CryptoOperations {
class CryptoOperationsImpl implements CryptoOperations {
@Override
public Cipher cryptor(KeyStore keyStore, String alias) throws UnrecoverableStorageKeyException {
@ -19,7 +19,7 @@ class CryptoOperationsFromApi23 implements CryptoOperations {
final javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" //
+ KeyProperties.BLOCK_MODE_CBC + "/" //
+ KeyProperties.ENCRYPTION_PADDING_PKCS7);
return new CipherFromApi23(cipher, key);
return new CipherImpl(cipher, key);
} catch (UnrecoverableKeyException e) {
throw new UnrecoverableStorageKeyException(e);
} catch (Exception e) {