Class RsaSigningKeyGenerator
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.keys.RsaSigningKeyGenerator
- All Implemented Interfaces:
SigningKeyGenerator
Generates RSA signing keys for the
RS256 algorithm. The identifier is a random UUID and the private half
leaves the generator already encrypted.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringAlgorithm the keys are used with.private final AesGcmKeyCipherEncrypts the private half.(package private) static final intSize in bits of the generated RSA keys. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a key in theSigningKeyStatus.NEXTstate.private static KeyPairGenerates an RSA key pair.
-
Field Details
-
KEY_SIZE
static final int KEY_SIZESize in bits of the generated RSA keys.- See Also:
-
ALGORITHM
Algorithm the keys are used with.- See Also:
-
cipher
Encrypts the private half.
-
-
Constructor Details
-
RsaSigningKeyGenerator
public RsaSigningKeyGenerator()
-
-
Method Details
-
generate
Generates a key in theSigningKeyStatus.NEXTstate.- Specified by:
generatein interfaceSigningKeyGenerator- Parameters:
now- instant at which it is generated.- Returns:
- the key.
- Throws:
IllegalStateException- if RSA is not available.
-
generateKeyPair
Generates an RSA key pair.- Returns:
- the key pair.
-