aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Smith <zach@driver.xyz>2017-05-30 09:24:13 -0700
committerZach Smith <zach@driver.xyz>2017-05-30 10:30:48 -0700
commit451e1562f55c836c0876400f5302d8732c478539 (patch)
tree62895f8c5a1a2259b2fa64e3a5e4d48eb99c49d2
parent20eac98ae18475f2d6dcaede653f6e9600673fc6 (diff)
downloaddriver-core-451e1562f55c836c0876400f5302d8732c478539.tar.gz
driver-core-451e1562f55c836c0876400f5302d8732c478539.tar.bz2
driver-core-451e1562f55c836c0876400f5302d8732c478539.zip
Trim newline from public key filev0.13.2
-rw-r--r--src/main/scala/xyz/driver/core/rest.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/core/rest.scala b/src/main/scala/xyz/driver/core/rest.scala
index f30d1ae..0484ab1 100644
--- a/src/main/scala/xyz/driver/core/rest.scala
+++ b/src/main/scala/xyz/driver/core/rest.scala
@@ -223,7 +223,7 @@ package rest {
object CachedTokenAuthorization {
def apply[U <: User](publicKeyFile: Path, issuer: String): CachedTokenAuthorization[U] = {
lazy val publicKey: PublicKey = {
- val publicKeyBase64Encoded = Files.readAllBytes(publicKeyFile)
+ val publicKeyBase64Encoded = new String(Files.readAllBytes(publicKeyFile)).trim
val publicKeyBase64Decoded = java.util.Base64.getDecoder.decode(publicKeyBase64Encoded)
val spec = new X509EncodedKeySpec(publicKeyBase64Decoded)
KeyFactory.getInstance("RSA").generatePublic(spec)