Class X509SvidValidator
java.lang.Object
io.spiffe.svid.x509svid.X509SvidValidator
Provides methods to validate a chain of X.509 certificates using an X.509 bundle source.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidverifyChain(@NonNull List<X509Certificate> chain, @NonNull BundleSource<X509Bundle> x509BundleSource) Verifies that a chain of certificates can be chained to one authority in the given X.509 bundle source.static voidverifySpiffeId(@NonNull X509Certificate x509Certificate, @NonNull Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier) Checks that the X.509 SVID provided has a SPIFFE ID that is in the Set of accepted SPIFFE IDs supplied.
-
Method Details
-
verifyChain
public static void verifyChain(@NonNull @NonNull List<X509Certificate> chain, @NonNull @NonNull BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException Verifies that a chain of certificates can be chained to one authority in the given X.509 bundle source.- Parameters:
chain- a list representing the chain of X.509 certificates to be validatedx509BundleSource- aBundleSourceto provide the authorities- Throws:
CertificateException- is the chain cannot be verified with an authority from the X.509 bundle sourceBundleNotFoundException- if no X.509 bundle for the trust domain could be found in the X.509 bundle sourceNullPointerException- if the given chain or 509BundleSource are null
-
verifySpiffeId
public static void verifySpiffeId(@NonNull @NonNull X509Certificate x509Certificate, @NonNull @NonNull Supplier<Set<SpiffeId>> acceptedSpiffeIdsSupplier) throws CertificateException Checks that the X.509 SVID provided has a SPIFFE ID that is in the Set of accepted SPIFFE IDs supplied.- Parameters:
x509Certificate- aX509Svidwith a SPIFFE ID to be verifiedacceptedSpiffeIdsSupplier- aSupplierof a Set of SPIFFE IDs that are accepted- Throws:
CertificateException- if the SPIFFE ID in x509Certificate is not in the Set supplied by acceptedSpiffeIdsSupplier, or if the SPIFFE ID cannot be parsed from the x509CertificateNullPointerException- if the given x509Certificate or acceptedSpiffeIdsSupplier are null
-