Giter Club home page Giter Club logo

Comments (5)

devabe avatar devabe commented on August 16, 2024

Found solution.

  1. It is necessary to put this code on common-crypt => KeystoreServiceImpl :

@Service("keystoreService")
public class KeystoreServiceImpl implements InitializingBean, KeystoreService
{
	@Autowired
	private CryptoProperties cryptoProperties;

	private PrivateKey privateKey;
	private PublicKey publicKey;

	public void afterPropertiesSet() throws Exception
	{
		try
		{
			KeyStore ks = KeyStore.getInstance("JCEKS");
			ks.load(new FileInputStream(cryptoProperties.getSimpleKeystore()), cryptoProperties.getSimplePassword().toCharArray());

			privateKey = (PrivateKey) ks.getKey(cryptoProperties.getKeyAlias(), cryptoProperties.getSimplePassword().toCharArray());

			publicKey = ks.getCertificate(cryptoProperties.getKeyAlias()).getPublicKey();
		}
		catch (Throwable e)
		{
			throw new IllegalArgumentException("Failed to read the private token key from the keystore", e);
		}
	}

	public PrivateKey getPrivateKey()
	{
		return privateKey;
	}

	public PublicKey getPublicKey()
	{
		return publicKey;
	}
}

  1. generate JCEKS with java Keytool :

keytool -genkeypair -alias ohadr -dname cn=localhost -validity 365 -keyalg DSA -keysize 1024 -keypass secret -storetype jceks -keystore keystore.jck -storepass secret

from authentication-flows.

OhadR avatar OhadR commented on August 16, 2024

thanks!

did you see this, in the wiki, regarding the keytool? https://github.com/OhadR/oAuth2-sample#keystore-things-to-know

from authentication-flows.

OhadR avatar OhadR commented on August 16, 2024

@devabe if this problem is solved, can you please close this issue?

from authentication-flows.

devabe avatar devabe commented on August 16, 2024

from authentication-flows.

OhadR avatar OhadR commented on August 16, 2024

thanks for closing.

if you have another issue, please do not hesitate to open a new one here (e.g. "check-token-enabled").

from authentication-flows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.