Provides implementation of CryptographyProvider via JDK built-in JCA
For supported targets and algorithms, please consult Supported primitives section
- KeyFormat: doesn't support
JWKkey format yet
Some specific algorithms (SHA3 family of digests on JDK 8) or parameters (secp256k1 curve for ECDSA) could be not supported by default JDK
provider, but it doesn't mean, that you cannot use them with cryptography-kotlin.
There is a possibility to create CryptographyProvider
from java.util.Provider, f.e.
using BouncyCastle:
val provider = CryptographyProvider.JDK(BouncyCastleProvider())
// get some algorithm which not supported on a JDK version or platform (in case of Android)
provider.get(SHA512)JDK provider is also tested via Android emulator on API level 21, 27 and 33. Supported algorithms on Android highly depend on Android API level and used provider. Some limitations are:
- default provider doesn't support
RSA-SSA-PSSorSHA3algorithms
For better compatibility, you can use BouncyCastle provider as shown in Custom Java providers.
val provider = CryptographyProvider.JDK // or CryptographyProvider.Default
// get some algorithm
provider.get(SHA512)dependencies {
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:0.4.0")
}Provides implementation of CryptographyProvider via JDK built-in JCA