Answer the question
In order to leave comments, you need to log in
How to properly import conscrypt in an android application?
Hello.
I can't figure out how to properly import classes from conscrypt in my application.
Initially, I didn't use it at all, and until recently it worked like this:
static Func (PrivateKey privkey) throws NoSuchAlgorithmException, InvalidKeySpecException {
if (privkey instanceof RSAPrivateCrtKey) {
<...>
RSAPrivateCrtKey rsaPriv = (RSAPrivateCrtKey) privkey;
// использование rsaPriv.getModulus() и rsaPriv.getPublicExponent();
<...>
} else if (privkey instanceof DSAPrivateKey) {
<...>
} else if (privkey instanceof ECPrivateKey) {
<...>
} else {
throw new NoSuchAlgorithmException("Ключ не является ни RSA, ни DSA, ни EC");
}
}
java.lang.ClassCastException: com.android.org.conscrypt.OpenSSLRSAPrivateKey cannot be cast to java.security.interfaces.RSAPrivateCrtKey
import org.conscrypt.OpenSSLRSAPrivateKey;
[javac] /home/mva/.vcs_repos/foo/Bar.java:74: error: package org.conscrypt does not exist
[javac] import org.conscrypt.OpenSSLRSAPrivateKey;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question