diff --git a/build.sbt b/build.sbt index e7d4b6c044..06c0aaa7db 100644 --- a/build.sbt +++ b/build.sbt @@ -603,14 +603,13 @@ lazy val utilSecurity = Project( id = "util-security", base = file("util-security") ).settings( - sharedSettings + sharedScala3EnabledSettings ).settings( name := "util-security", libraryDependencies ++= Seq( scalacheckLib, - "org.scalatestplus" %% "scalacheck-1-14" % "3.1.2.0" % "test", snakeyaml - ) + ) ++ scalatestScalacheckVersionedDep(scalaVersion.value) ).dependsOn(utilCore, utilLogging, utilSecurityTestCerts % "test") lazy val utilSecurityTestCerts = Project( diff --git a/util-security/src/main/scala/com/twitter/util/security/X509CertificateDeserializer.scala b/util-security/src/main/scala/com/twitter/util/security/X509CertificateDeserializer.scala index e208cb74c7..9b2b36f34d 100644 --- a/util-security/src/main/scala/com/twitter/util/security/X509CertificateDeserializer.scala +++ b/util-security/src/main/scala/com/twitter/util/security/X509CertificateDeserializer.scala @@ -3,7 +3,8 @@ package com.twitter.util.security import com.twitter.util.Try import java.io.ByteArrayInputStream -import java.security.cert.{CertificateFactory, X509Certificate} +import java.security.cert.CertificateFactory +import java.security.cert.X509Certificate /** * A helper object to deserialize PEM-encoded X.509 Certificates. @@ -15,7 +16,7 @@ import java.security.cert.{CertificateFactory, X509Certificate} */ object X509CertificateDeserializer { private[this] val MessageType: String = "CERTIFICATE" - private[this] val deserializeX509: Array[Byte] => X509Certificate = { certBytes: Array[Byte] => + private[this] val deserializeX509: Array[Byte] => X509Certificate = { (certBytes: Array[Byte]) => val certFactory = CertificateFactory.getInstance("X.509") val certificate = certFactory .generateCertificate(new ByteArrayInputStream(certBytes))