Created
October 14, 2022 20:36
-
-
Save nipunthathsara/59541b013be734719d51addd05723ed1 to your computer and use it in GitHub Desktop.
Access beans from static context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static CryptoProperties cryptoProperties; | |
@Autowired | |
public CsrUtils(ApplicationContext applicationContext) { | |
cryptoProperties = applicationContext.getBean(CryptoProperties.class); | |
} | |
public static KeyPair generateKeyPair() { | |
... | |
String algo = cryptoProperties.getKeyPairAlgorithm(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment