Class DSSSecurityFactory<I,O>
java.lang.Object
eu.europa.esig.dss.spi.security.DSSSecurityFactory<I,O>
- Type Parameters:
I- represents an input object for the result generationO- represents an output of the building process
- Direct Known Subclasses:
DSSCertificateTokenSecurityFactory, DSSContentVerifierProviderSecurityFactory, DSSKeyPairGeneratorSecurityFactory, DSSP7CCertificatesSecurityFactory, DSSSignatureSecurityFactory, DSSSignerInformationVerifierSecurityFactory
This class provides an abstract logic to load securely Java Cryptographic Architecture classes,
based on
eu.europa.esig.dss.spi.DSSSecurityProvider's configuration.
The implementation will initially use the primary security provider to load a given token,
and only in case of a failure of the main security provider, the implementation will try to perform
the same operation using alternative security providers, until the first success.
The first successful result is returned immediately, while in case of failure of all security providers,
the class will throw a eu.europa.esig.dss.model.DSSException.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method implements the main logic to load a given token.protected OBuilds the result based on the given input using the alternative security providers.protected OBuilds the result based on the given input using the primary security provider.protected abstract ObuildWithProvider(I input, Provider securityProvider) Builds the result using a givensecurityProviderprotected abstract StringGets the factory class nameprotected abstract StringGets a string representation for the giveninput
-
Constructor Details
-
DSSSecurityFactory
protected DSSSecurityFactory()Default constructor
-
-
Method Details
-
build
This method implements the main logic to load a given token. It will first try to generate the output result using a main security provider fromDSSSecurityProvider, and only in case of failure will try to use alternative security providers until the first success.- Parameters:
input- object to be used as an input for result generation- Returns:
- output object result
-
buildWithPrimarySecurityProvider
-
buildWithAlternativeSecurityProviders
Builds the result based on the given input using the alternative security providers. The method iterates accords all available alternative security providers until the first successful result and returns it. If the build fails for all security providers, it returns a NULL value.- Parameters:
input- object to be used as an input for result generation- Returns:
- output object result
-
getFactoryClassName
-
toString
-
buildWithProvider
Builds the result using a givensecurityProvider
-