Class DefaultCredentialTestFunction
java.lang.Object
se.swedenconnect.security.credential.monitoring.DefaultCredentialTestFunction
- All Implemented Interfaces:
Function<ReloadablePkiCredential,Exception>
public class DefaultCredentialTestFunction
extends Object
implements Function<ReloadablePkiCredential,Exception>
A default credential test function that tests a credential by getting a private key reference and signs test data
using this key. The following key algorithms are supported:
- RSA -
SHA256withRSAis the default algorithm when signing. - DSA -
SHA256withDSAis the default algorithm when signing. - EC -
SHA256withECDSAis the default algorithm when signing.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ReloadablePkiCredential credential) voidsetDsaSignatureAlgorithm(String dsaSignatureAlgorithm) Assigns the DSA signature algorithm to use.voidsetEcSignatureAlgorithm(String ecSignatureAlgorithm) Assigns the EC signature algorithm to use.voidsetProvider(String provider) The name for a specific securityProviderto use.voidsetRsaSignatureAlgorithm(String rsaSignatureAlgorithm) Assigns the RSA signature algorithm to use.
-
Constructor Details
-
DefaultCredentialTestFunction
public DefaultCredentialTestFunction()
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<ReloadablePkiCredential,Exception>
-
setProvider
The name for a specific securityProviderto use.- Parameters:
provider- provider name
-
setRsaSignatureAlgorithm
Assigns the RSA signature algorithm to use. Defaults to SHA256withRSA.- Parameters:
rsaSignatureAlgorithm- the JCA algorithm name
-
setDsaSignatureAlgorithm
Assigns the DSA signature algorithm to use. Defaults to SHA256withDSA.- Parameters:
dsaSignatureAlgorithm- the JCA algorithm name
-
setEcSignatureAlgorithm
Assigns the EC signature algorithm to use. Defaults to SHA256withECDSA.- Parameters:
ecSignatureAlgorithm- the JCA algorithm name
-