mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
Update PasswordVerifier.java
Добавил: 1. Способ верификации "django", для осуществления авторизации с помощью PBKDF2 с SHA256. 2. Исключение на отсутствующий алгоритм(NoSuchAlgorithmException) 3. Исключение на неверные ключи(InvalidKeySpecException)
This commit is contained in:
parent
8bf58cff18
commit
90ee90973e
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
|
||||
public abstract class PasswordVerifier {
|
||||
public static final ProviderMap<PasswordVerifier> providers = new ProviderMap<>("PasswordVerifier");
|
||||
private static boolean registeredProviders = false;
|
||||
|
@ -14,11 +17,12 @@ public static void registerProviders() {
|
|||
providers.register("json", JsonPasswordVerifier.class);
|
||||
providers.register("accept", AcceptPasswordVerifier.class);
|
||||
providers.register("reject", RejectPasswordVerifier.class);
|
||||
providers.register("django", DjangoPasswordVerifier.class);
|
||||
registeredProviders = true;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract boolean check(String encryptedPassword, String password);
|
||||
public abstract boolean check(String encryptedPassword, String password) throws NoSuchAlgorithmException, InvalidKeySpecException;
|
||||
|
||||
public String encrypt(String password) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
Loading…
Reference in a new issue