Package org.bouncycastle.crypto.fips
Class FipsDSA.OperatorFactory
java.lang.Object
org.bouncycastle.crypto.fips.FipsSignatureOperatorFactory<FipsDSA.Parameters>
org.bouncycastle.crypto.fips.FipsDSA.OperatorFactory
- All Implemented Interfaces:
SignatureOperatorFactory<FipsDSA.Parameters>
- Enclosing class:
- FipsDSA
public static final class FipsDSA.OperatorFactory
extends FipsSignatureOperatorFactory<FipsDSA.Parameters>
Operator factory for creating DSA based signing and verification operators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSigner
(AsymmetricPrivateKey key, FipsDSA.Parameters parameters) Return a generator of DSA signatures.createValidator
(AsymmetricPublicKey key, FipsDSA.Parameters parameters, byte[] signature) Create a validator for DSA signatures.createVerifier
(AsymmetricPublicKey key, FipsDSA.Parameters parameters) Create a verifier for DSA signatures.
-
Constructor Details
-
OperatorFactory
public OperatorFactory()
-
-
Method Details
-
createSigner
public FipsOutputSignerUsingSecureRandom<FipsDSA.Parameters> createSigner(AsymmetricPrivateKey key, FipsDSA.Parameters parameters) Return a generator of DSA signatures. Note this operator needs to be associated with a SecureRandom to be fully initialised. FIPS 186-5 no longer approves of DSA, hence signing is disabled for FIPS mode.- Specified by:
createSigner
in interfaceSignatureOperatorFactory<FipsDSA.Parameters>
- Specified by:
createSigner
in classFipsSignatureOperatorFactory<FipsDSA.Parameters>
- Parameters:
key
- the key to initialize the signature generator with.parameters
- parameters required to configure the generation.- Returns:
- an OutputSignerUsingSecureRandom.
-
createVerifier
public FipsOutputVerifier<FipsDSA.Parameters> createVerifier(AsymmetricPublicKey key, FipsDSA.Parameters parameters) Create a verifier for DSA signatures.- Specified by:
createVerifier
in interfaceSignatureOperatorFactory<FipsDSA.Parameters>
- Specified by:
createVerifier
in classFipsSignatureOperatorFactory<FipsDSA.Parameters>
- Parameters:
key
- the key to initialize the verifier with.parameters
- parameters required to configure the verification.- Returns:
- an OutputVerifier.
-
createValidator
public FipsOutputValidator<FipsDSA.Parameters> createValidator(AsymmetricPublicKey key, FipsDSA.Parameters parameters, byte[] signature) throws InvalidSignatureException Create a validator for DSA signatures.- Parameters:
key
- the key to initialize the verifier with.parameters
- parameters required to configure the verification.signature
- the signature the data is to be validated against.- Returns:
- an OutputVerifier.
- Throws:
InvalidSignatureException
-