Merge pull request #8648 from Isira-Seneviratne/Use_IO_extensions
Use IO extensions.
This commit is contained in:
commit
3281ed2ef1
3 changed files with 8 additions and 39 deletions
|
|
@ -7,8 +7,6 @@ import org.schabi.newpipe.App
|
|||
import org.schabi.newpipe.error.ErrorInfo
|
||||
import org.schabi.newpipe.error.ErrorUtil.Companion.createNotification
|
||||
import org.schabi.newpipe.error.UserAction
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.InputStream
|
||||
import java.security.MessageDigest
|
||||
import java.security.NoSuchAlgorithmException
|
||||
import java.security.cert.CertificateEncodingException
|
||||
|
|
@ -47,10 +45,8 @@ object ReleaseVersionUtil {
|
|||
return ""
|
||||
}
|
||||
val x509cert = try {
|
||||
val cert = signatures[0].toByteArray()
|
||||
val input: InputStream = ByteArrayInputStream(cert)
|
||||
val cf = CertificateFactory.getInstance("X509")
|
||||
cf.generateCertificate(input) as X509Certificate
|
||||
cf.generateCertificate(signatures[0].toByteArray().inputStream()) as X509Certificate
|
||||
} catch (e: CertificateException) {
|
||||
showRequestError(app, e, "Certificate error")
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue