java.lang.Object
org.miaixz.bus.http.secure.BasicTrustRootIndex
- All Implemented Interfaces:
TrustRootIndex
An in-memory index of trusted root certificates. This class holds a cache of CA certificates, indexed by their
subject distinguished name, to allow for quick lookups when building a certificate chain.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionBasicTrustRootIndex(X509Certificate... caCerts) Creates a new index from a set of CA certificates. -
Method Summary
Modifier and TypeMethodDescriptionbooleanFinds a trusted CA certificate that signed the given certificate.inthashCode()
-
Constructor Details
-
BasicTrustRootIndex
Creates a new index from a set of CA certificates.- Parameters:
caCerts- The trusted CA certificates.
-
-
Method Details
-
findByIssuerAndSignature
Finds a trusted CA certificate that signed the given certificate. This method works by first finding candidate certificates based on the issuer's distinguished name and then verifying the signature.- Specified by:
findByIssuerAndSignaturein interfaceTrustRootIndex- Parameters:
cert- The certificate for which to find the issuer.- Returns:
- The signing CA certificate, or
nullif no trusted issuer is found.
-
equals
-
hashCode
public int hashCode()
-