- java.lang.Object
-
- io.github.mmm.crypto.CryptoAccess
-
- io.github.mmm.crypto.asymmetric.access.AsymmetricAccess<SignatureRsa,RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa,AsymmetricKeyCreatorRsa>
-
- io.github.mmm.crypto.asymmetric.access.rsa.Rsa
-
- All Implemented Interfaces:
AbstractCryptoFactory,AsymmetricCryptorFactory<RSAPrivateKey,RSAPublicKey>,AsymmetricKeyCreatorFactory<AsymmetricKeyCreatorRsa>,SignatureFactory<SignatureRsa>,SignatureProcessorFactory<SignatureRsa,RSAPrivateKey,RSAPublicKey>,CryptorFactory,HashFactory,KeyCreatorFactory
public final class Rsa extends AsymmetricAccess<SignatureRsa,RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa,AsymmetricKeyCreatorRsa>
Direct builder for RSA (Ron Rivest, Adi Shamir and Leonard Adleman) used by PGP/GPG and many others. For details see PKCS #1.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Field Summary
-
Fields inherited from class io.github.mmm.crypto.asymmetric.access.AsymmetricAccess
cryptorConfig, randomFactory
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AsymmetricKeyCreatorRsanewKeyCreator()static Rsaof(int keyLength, HashConfig hashConfig)static Rsaof(int keyLength, HashConfig hashConfig, RandomFactory randomFactory)static Rsaof(int keyLength, HashConfig hashConfig, String hashAlgorithm, RandomFactory randomFactory, SecurityProvider provider)static Rsaof(int keyLength, String hashAlgorithm)static Rsaof4096(HashConfig hashConfig)static Rsaof4096(String hashAlgorithm)-
Methods inherited from class io.github.mmm.crypto.asymmetric.access.AsymmetricAccess
createSignature, getCryptorConfig, getSignatureConfig, getSignatureFactoryWithoutHash, newDecryptor, newDecryptorUnsafe, newEncryptor, newEncryptorUnsafe, newHashCreator, newSigner, newVerifier
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.sign.SignatureProcessorFactory
newSignerUnsafe, newVerifierUnsafe
-
-
-
-
Method Detail
-
newKeyCreator
public AsymmetricKeyCreatorRsa newKeyCreator()
- Returns:
- a new instance of
KeyCreator. May be reused but is not guaranteed to be thread-safe.
-
of4096
public static Rsa of4096(String hashAlgorithm)
- Parameters:
hashAlgorithm- thealgorithmfor the hash used for signatures.- Returns:
- a
Rsainstance with akey lengthof 4096 bits.
-
of4096
public static Rsa of4096(HashConfig hashConfig)
- Parameters:
hashConfig- theHashConfigfor hashing data forsignatures.- Returns:
- a
Rsainstance with akey lengthof 4096 bits.
-
of
public static Rsa of(int keyLength, String hashAlgorithm)
- Parameters:
keyLength- thekey lengthin bits.hashAlgorithm- thealgorithmfor the hash used for signatures.- Returns:
- the according
Rsainstance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig)
- Parameters:
keyLength- thekey lengthin bits.hashConfig- theHashConfigfor hashing data forsignatures.- Returns:
- the according
Rsainstance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig, RandomFactory randomFactory)
- Parameters:
keyLength- thekey lengthin bits.hashConfig- theHashConfigfor hashing data forsignatures.randomFactory- theRandomFactory.- Returns:
- the according
Rsainstance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig, String hashAlgorithm, RandomFactory randomFactory, SecurityProvider provider)
- Parameters:
keyLength- thekey lengthin bits.hashConfig- theHashConfigfor hashing data forsignatures.hashAlgorithm- thehash algorithmfor the signature (e.g. for HMac).randomFactory- theRandomFactory.provider- theSecurityProviderto use.- Returns:
- the according
Rsainstance.
-
-