Module io.github.mmm.crypto.bc
Class SignatureProcessorFactoryImplEcBc<S extends SignatureEcBc>
- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.asymmetric.sign.ec.bc.SignatureProcessorFactoryImplEcBc<S>
-
- Type Parameters:
S
- type ofSignatureBinary
.
- All Implemented Interfaces:
CryptoAlgorithm
,SignatureFactory<S>
,SignatureProcessorFactory<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
public class SignatureProcessorFactoryImplEcBc<S extends SignatureEcBc> extends AbstractSecurityAlgorithm implements SignatureProcessorFactory<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
Default implementation ofSignatureProcessorFactory
forSignatureEcBc
.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description SignatureProcessorFactoryImplEcBc(SignatureConfigEcDsa<S> config)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description S
createSignature(byte[] data)
String
getAlgorithm()
SignatureProcessorFactory<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
getSignatureFactoryWithoutHash()
SignatureSigner<S>
newSigner(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
SignatureVerifier<S>
newVerifier(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
creationFailedException, creationFailedException, creationFailedException, creationFailedException, getAlgorithm, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.sign.SignatureProcessorFactory
newSignerUnsafe, newVerifierUnsafe
-
-
-
-
Constructor Detail
-
SignatureProcessorFactoryImplEcBc
public SignatureProcessorFactoryImplEcBc(SignatureConfigEcDsa<S> config)
The constructor.- Parameters:
config
- theSignatureConfig
.
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceCryptoAlgorithm
- Returns:
- the name of the underlying algorithm (e.g. "RSA", "NONEwithECDSA", etc.).
- See Also:
Key.getAlgorithm()
,Signature.getAlgorithm()
,MessageDigest.getAlgorithm()
,SecureRandom.getAlgorithm()
,Cipher.getAlgorithm()
-
newSigner
public SignatureSigner<S> newSigner(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
- Specified by:
newSigner
in interfaceSignatureProcessorFactory<S extends SignatureEcBc,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
- Parameters:
privateKey
- thePrivateKey
to use for signing.- Returns:
- the
SignatureSigner
for signing.
-
newVerifier
public SignatureVerifier<S> newVerifier(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
- Specified by:
newVerifier
in interfaceSignatureProcessorFactory<S extends SignatureEcBc,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
- Parameters:
publicKey
- thePublicKey
to use for verifying.- Returns:
- the
SignatureVerifier
for verifying.
-
createSignature
public S createSignature(byte[] data)
- Specified by:
createSignature
in interfaceSignatureFactory<S extends SignatureEcBc>
- Parameters:
data
- thebinary signature data
.- Returns:
- the deserialized
SignatureBinary
.
-
getSignatureFactoryWithoutHash
public SignatureProcessorFactory<S,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey> getSignatureFactoryWithoutHash()
- Specified by:
getSignatureFactoryWithoutHash
in interfaceSignatureProcessorFactory<S extends SignatureEcBc,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
- Returns:
- an instance of this
SignatureFactory
that does not hash before signing so you can control the hashing manually and only sign the resulting hash (e.g. to reuse the hash value for further calculations).
-
-