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 -
SHA256withRSA
is the default algorithm when signing. - DSA -
SHA256withDSA
is the default algorithm when signing. - EC -
SHA256withECDSA
is the default algorithm when signing.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(ReloadablePkiCredential credential) void
setDsaSignatureAlgorithm
(String dsaSignatureAlgorithm) Assigns the DSA signature algorithm to use.void
setEcSignatureAlgorithm
(String ecSignatureAlgorithm) Assigns the EC signature algorithm to use.void
setProvider
(String provider) The name for a specific securityProvider
to use.void
setRsaSignatureAlgorithm
(String rsaSignatureAlgorithm) Assigns the RSA signature algorithm to use.
-
Constructor Details
-
DefaultCredentialTestFunction
public DefaultCredentialTestFunction()
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<ReloadablePkiCredential,
Exception>
-
setProvider
The name for a specific securityProvider
to 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
-