Package java.security.cert
Class CertPathBuilder
- java.lang.Object
-
- java.security.cert.CertPathBuilder
-
public class CertPathBuilder extends Object
This class implements the functionality of a builder for an unverified Certification Paths from a specified certificate to a trust anchor.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCertPathBuilder(CertPathBuilderSpi builderSpi, Provider provider, String algorithm)Creates a newCertPathBuilder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CertPathBuilderResultbuild(CertPathParameters params)Builds a certification path with the specified algorithm parameters.StringgetAlgorithm()Returns the algorithm name of this instance.static StringgetDefaultType()Returns the defaultCertPathBuildertype from the Security Properties.static CertPathBuildergetInstance(String algorithm)Creates a newCertPathBuilderinstance with the specified algorithm.static CertPathBuildergetInstance(String algorithm, String provider)Creates a newCertPathBuilderinstance from the specified provider providing the specified algorithm.static CertPathBuildergetInstance(String algorithm, Provider provider)Creates a newCertPathBuilderinstance from the specified provider providing the specified algorithm.ProvidergetProvider()Returns the provider of this instance.
-
-
-
Constructor Detail
-
CertPathBuilder
protected CertPathBuilder(CertPathBuilderSpi builderSpi, Provider provider, String algorithm)
Creates a newCertPathBuilder.- Parameters:
builderSpi- the implementation delegate.provider- the provider.algorithm- the desired algorithm available at the provider.
-
-
Method Detail
-
getAlgorithm
public final String getAlgorithm()
Returns the algorithm name of this instance.- Returns:
- the algorithm name of this instance.
-
getProvider
public final Provider getProvider()
Returns the provider of this instance.- Returns:
- the provider of this instance.
-
getInstance
public static CertPathBuilder getInstance(String algorithm) throws NoSuchAlgorithmException
Creates a newCertPathBuilderinstance with the specified algorithm.- Parameters:
algorithm- the name of the algorithm.- Returns:
- a builder for the requested algorithm.
- Throws:
NullPointerException- if the algorithm isnull.NoSuchAlgorithmException- if no installed provider can provide the algorithm.
-
getInstance
public static CertPathBuilder getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
Creates a newCertPathBuilderinstance from the specified provider providing the specified algorithm.- Parameters:
algorithm- the name of the algorithm.provider- the name of the provider.- Returns:
- a builder for the requested algorithm.
- Throws:
NoSuchAlgorithmException- if the specified provider cannot provide the algorithm.NoSuchProviderException- if no provider with the specified name can be found.NullPointerException- if algorithm isnull.IllegalArgumentException- ifprovider == null || provider.isEmpty()
-
getInstance
public static CertPathBuilder getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
Creates a newCertPathBuilderinstance from the specified provider providing the specified algorithm.- Parameters:
algorithm- the name of the algorithm.provider- the provider.- Returns:
- a builder for the requested algorithm
- Throws:
NoSuchAlgorithmException- if the specified provider cannot provide the algorithm.IllegalArgumentException- ifprovider == nullNullPointerException- if algorithm isnull.
-
build
public final CertPathBuilderResult build(CertPathParameters params) throws CertPathBuilderException, InvalidAlgorithmParameterException
Builds a certification path with the specified algorithm parameters.- Parameters:
params- the algorithm parameters.- Returns:
- the built certification path.
- Throws:
CertPathBuilderException- if the build fails.InvalidAlgorithmParameterException- if the specified parameters cannot be used to build with this builder.- See Also:
CertPathBuilderResult
-
getDefaultType
public static final String getDefaultType()
Returns the defaultCertPathBuildertype from the Security Properties.- Returns:
- the default
CertPathBuildertype from the Security Properties, or the string "PKIX" if it cannot be determined.
-
-