From 8a32b359eed27ab1d4e054ffed99b6602fa18acf Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 21 Dec 2022 02:23:44 +0300 Subject: Sign in with Apple: adopt records --- src/main/java/com/juick/config/SignInWithAppleConfig.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/config/SignInWithAppleConfig.java b/src/main/java/com/juick/config/SignInWithAppleConfig.java index 85e2bdd1..2b0d3698 100644 --- a/src/main/java/com/juick/config/SignInWithAppleConfig.java +++ b/src/main/java/com/juick/config/SignInWithAppleConfig.java @@ -23,10 +23,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; +import org.tomitribe.churchkey.Keys; import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.spec.InvalidKeySpecException; @Configuration public class SignInWithAppleConfig { @@ -40,8 +39,8 @@ public class SignInWithAppleConfig { private Resource keyPath; @Bean - AppleClientSecretGenerator clientSecretGenerator() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { + AppleClientSecretGenerator clientSecretGenerator() throws IOException { byte[] pemData = IOUtils.toByteArray(keyPath.getInputStream()); - return new AppleClientSecretGenerator(appId, teamId, keyId, pemData); + return new AppleClientSecretGenerator(appId, teamId, keyId, Keys.decode(pemData)); } } -- cgit v1.2.3