I'm implementing communication using X509Certificates and are struggling with validating the certificate.
I've gotten a "parent" certificate that is self-signed and used to sign all other certificates.
This has been done and I've gotten the certificate.
In the next step, the other part is signing my certificates and I'm to store them.
Here is the first problem: My certificates that is returned does not correspond to the once I've created, so the public key differs. How can I now update my keystore with the signed certificate? Hence I need the privatekey from my certificate but I need the signed version from the returned certificate.
Next problem: The signed certificates needs to be validated and checked against the parent certificate, but when doing this, like follows:
X509Certificate parent;
X509Certificate certToVerify;
parent.verify(certToVerify.getPublicKey());
It throws, signature error, java.security.SignatureException: Signature does not match.
Is there any other way that I should check the issuer or verify the certificate? Is there something I've missed?
best, Henrik