Module io.github.mmm.crypto
Class AsymmetricKeyCreatorRsa
- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
-
- io.github.mmm.crypto.algorithm.CryptoAlgorithmImpl
-
- io.github.mmm.crypto.algorithm.CryptoAlgorithmImplWithRandom
-
- io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyCreator<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
-
- io.github.mmm.crypto.asymmetric.key.rsa.AsymmetricKeyCreatorRsa
-
- All Implemented Interfaces:
CryptoAlgorithm,AsymmetricKeyCreator<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>,AsymmetricKeyPairFactory<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>,AsymmetricKeyPairFactorySimple<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>,PrivateKeyFactory<RSAPrivateKey>,PublicKeyFactory<RSAPublicKey>,KeyCreator
public class AsymmetricKeyCreatorRsa extends AbstractAsymmetricKeyCreator<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
Implementation ofAsymmetricKeyCreatorforRSA.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
provider
-
-
Constructor Summary
Constructors Constructor Description AsymmetricKeyCreatorRsa(int keyLength)The constructor.AsymmetricKeyCreatorRsa(int keyLength, SecurityProvider provider, RandomFactory randomFactory)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsymmetricKeyPairRsacreateKeyPair(RSAPrivateKey privateKey, RSAPublicKey publicKey)intgetKeyLength(RSAPrivateKey privateKey)intgetKeyLength(RSAPublicKey publicKey)-
Methods inherited from class io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyCreator
asData, asData, asData, createKeyPair, createPrivateKey, createPublicKey, generateKeyPair, getKeyLength, init, register, register
-
Methods inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmImplWithRandom
createSecureRandom, getRandomFactory
-
Methods inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmImpl
getAlgorithm
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
getProvider
-
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.key.AsymmetricKeyCreator
asBinary, asBinary, asBinary, asData, asData, asData, createKeyPair, createPrivateKey, createPublicKey, verifyKey, verifyKey
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.AsymmetricKeyPairFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.algorithm.CryptoAlgorithm
getAlgorithm
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PrivateKeyFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PublicKeyFactory
asBinary
-
-
-
-
Constructor Detail
-
AsymmetricKeyCreatorRsa
public AsymmetricKeyCreatorRsa(int keyLength)
The constructor.- Parameters:
keyLength- thekey length.
-
AsymmetricKeyCreatorRsa
public AsymmetricKeyCreatorRsa(int keyLength, SecurityProvider provider, RandomFactory randomFactory)The constructor.- Parameters:
keyLength- thekey length.provider- theprovider.randomFactory- therandom factory.
-
-
Method Detail
-
createKeyPair
public AsymmetricKeyPairRsa createKeyPair(RSAPrivateKey privateKey, RSAPublicKey publicKey)
- Parameters:
privateKey- thePrivateKey.publicKey- the correspondingPublicKey.- Returns:
- the
AsymmetricKeyPair.
-
getKeyLength
public int getKeyLength(RSAPrivateKey privateKey)
- Parameters:
privateKey- thePrivateKey.- Returns:
- the
key lengthof the given key in bits.
-
getKeyLength
public int getKeyLength(RSAPublicKey publicKey)
- Parameters:
publicKey- thePublicKey.- Returns:
- the
key lengthof the given key in bits.
-
-