|
@@ -46,7 +46,6 @@ import com.owncloud.android.lib.resources.e2ee.UpdateMetadataRemoteOperation;
|
|
|
import com.owncloud.android.operations.UploadException;
|
|
|
|
|
|
import org.apache.commons.httpclient.HttpStatus;
|
|
|
-import org.conscrypt.OpenSSLRSAPublicKey;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
import java.io.ByteArrayInputStream;
|
|
@@ -72,6 +71,7 @@ import java.security.cert.CertificateException;
|
|
|
import java.security.cert.CertificateFactory;
|
|
|
import java.security.cert.X509Certificate;
|
|
|
import java.security.interfaces.RSAPrivateCrtKey;
|
|
|
+import java.security.interfaces.RSAPublicKey;
|
|
|
import java.security.spec.InvalidKeySpecException;
|
|
|
import java.security.spec.KeySpec;
|
|
|
import java.security.spec.PKCS8EncodedKeySpec;
|
|
@@ -855,7 +855,7 @@ public final class EncryptionUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static OpenSSLRSAPublicKey convertPublicKeyFromString(String string) throws CertificateException {
|
|
|
+ public static RSAPublicKey convertPublicKeyFromString(String string) throws CertificateException {
|
|
|
String trimmedCert = string.replace("-----BEGIN CERTIFICATE-----\n", "")
|
|
|
.replace("-----END CERTIFICATE-----\n", "");
|
|
|
byte[] encodedCert = trimmedCert.getBytes(StandardCharsets.UTF_8);
|
|
@@ -864,7 +864,7 @@ public final class EncryptionUtils {
|
|
|
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
|
|
|
InputStream in = new ByteArrayInputStream(decodedCert);
|
|
|
X509Certificate certificate = (X509Certificate) certFactory.generateCertificate(in);
|
|
|
- return (OpenSSLRSAPublicKey) certificate.getPublicKey();
|
|
|
+ return (RSAPublicKey) certificate.getPublicKey();
|
|
|
}
|
|
|
|
|
|
public static void removeE2E(ArbitraryDataProvider arbitraryDataProvider, User user) {
|
|
@@ -877,7 +877,7 @@ public final class EncryptionUtils {
|
|
|
public static boolean isMatchingKeys(KeyPair keyPair, String publicKeyString) throws CertificateException {
|
|
|
// check key
|
|
|
RSAPrivateCrtKey privateKey = (RSAPrivateCrtKey) keyPair.getPrivate();
|
|
|
- OpenSSLRSAPublicKey publicKey = EncryptionUtils.convertPublicKeyFromString(publicKeyString);
|
|
|
+ RSAPublicKey publicKey = EncryptionUtils.convertPublicKeyFromString(publicKeyString);
|
|
|
|
|
|
BigInteger modulusPublic = publicKey.getModulus();
|
|
|
BigInteger modulusPrivate = privateKey.getModulus();
|