- 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 AsymmetricKeyCreatorRsa
newKeyCreator()
static Rsa
of(int keyLength, HashConfig hashConfig)
static Rsa
of(int keyLength, HashConfig hashConfig, RandomFactory randomFactory)
static Rsa
of(int keyLength, HashConfig hashConfig, String hashAlgorithm, RandomFactory randomFactory, SecurityProvider provider)
static Rsa
of(int keyLength, String hashAlgorithm)
static Rsa
of4096(HashConfig hashConfig)
static Rsa
of4096(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
- thealgorithm
for the hash used for signatures.- Returns:
- a
Rsa
instance with akey length
of 4096 bits.
-
of4096
public static Rsa of4096(HashConfig hashConfig)
- Parameters:
hashConfig
- theHashConfig
for hashing data forsignatures
.- Returns:
- a
Rsa
instance with akey length
of 4096 bits.
-
of
public static Rsa of(int keyLength, String hashAlgorithm)
- Parameters:
keyLength
- thekey length
in bits.hashAlgorithm
- thealgorithm
for the hash used for signatures.- Returns:
- the according
Rsa
instance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig)
- Parameters:
keyLength
- thekey length
in bits.hashConfig
- theHashConfig
for hashing data forsignatures
.- Returns:
- the according
Rsa
instance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig, RandomFactory randomFactory)
- Parameters:
keyLength
- thekey length
in bits.hashConfig
- theHashConfig
for hashing data forsignatures
.randomFactory
- theRandomFactory
.- Returns:
- the according
Rsa
instance.
-
of
public static Rsa of(int keyLength, HashConfig hashConfig, String hashAlgorithm, RandomFactory randomFactory, SecurityProvider provider)
- Parameters:
keyLength
- thekey length
in bits.hashConfig
- theHashConfig
for hashing data forsignatures
.hashAlgorithm
- thehash algorithm
for the signature (e.g. for HMac).randomFactory
- theRandomFactory
.provider
- theSecurityProvider
to use.- Returns:
- the according
Rsa
instance.
-
-