Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto API Multiplatform #61

Open
RiccardoM opened this issue Mar 11, 2019 · 1 comment
Open

Crypto API Multiplatform #61

RiccardoM opened this issue Mar 11, 2019 · 1 comment

Comments

@RiccardoM
Copy link
Contributor

Currently inside the crypto_api package we find the following piece of code:

fun <T> loadClass(name: String): T = try {
    @Suppress("UNCHECKED_CAST")
    Class.forName("org.kethereum.crypto.impl.$name").newInstance() as T
} catch (e: ClassNotFoundException) {
    throw RuntimeException("There is not implementation found for $name - you need to either depend on crypto_impl_spongycastle or crypto_impl_bouncycastle")
}

While this works for JVM based project, I am not sure it will work on multiplatform projects too.

I think, but I might be wrong, that we could replace the loadClass method with the actual/expected mechanism allowing this library to be used inside multiplatform projects too.

@ligi
Copy link
Member

ligi commented Mar 11, 2019

That's a good point. Would totally accept a PR with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants