@ SneakyThrows public static PublicKey extractPublicKeyFromResource ( final String secretKeyToUse ) { LOGGER . debug ( "Attempting to extract public key from [{}]..." , secretKeyToUse ) ; val resource = ResourceUtils . getResourceFrom ( secretKeyToUse ) ; val factory = new PublicKeyFactoryBean ( ) ; factory . setAlgorithm ( RsaKeyUtil . RSA ) ; factory . setResource ( resource ) ; factory . setSingleton ( false ) ; return factory . getObject ( ) ; }
Extract public key from resource public key .