Verify that the leaf certificate was signed by the sub-CA certificate

家住魔仙堡 提交于 2019-12-11 05:47:13

问题


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:


Use this snippet

X509Certificate certificate =...
X509Certificate intermediate = ...
try{
    certificate.verify(intermediate.getPublicKey());
        //Verification ok.    intermediate  is the issuer
    } catch (Exception e){}
}


来源:https://stackoverflow.com/questions/42287576/verify-that-the-leaf-certificate-was-signed-by-the-sub-ca-certificate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!