Verify that the leaf certificate was signed by the

2019-09-14 01:42发布

I have the Apple Root CA - G3 root Certificate and I need to validate the chain of trust. I need to verify that the leaf certificate was signed by the sub-CA certificate.

How can I do this with Java?

1条回答
唯我独甜
2楼-- · 2019-09-14 01:51

Use this snippet

X509Certificate certificate =...
X509Certificate intermediate = ...
try{
    certificate.verify(intermediate.getPublicKey());
        //Verification ok.    intermediate  is the issuer
    } catch (Exception e){}
}
查看更多
登录 后发表回答