Fixed that "PBKDF2" has been used instead of nameStartsWith

This commit is contained in:
dankito 2020-10-17 23:48:44 +02:00
parent 732ddd5b2b
commit d5786dd5c2
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ open class CryptographyManager {
}
open fun findBestMatchingAlgorithm(type: SecurityProviderServiceType, nameStartsWith: String, vararg preferredAlgorithms: String): String? {
val supportedAlgorithms = listServiceTypeAlgorithmsWithName(type, "PBKDF2")
val supportedAlgorithms = listServiceTypeAlgorithmsWithName(type, nameStartsWith)
val bestMatchingAlgorithm = preferredAlgorithms.firstOrNull { supportedAlgorithms.contains(it) }
?: supportedAlgorithms.maxBy { it.length }