Class InvalidKeySizeException

All Implemented Interfaces:
Serializable

public class InvalidKeySizeException extends IllegalArgumentException
Thrown by AesGcmCipher(byte[]) when the key is not 16, 24, or 32 bytes (AES-128/192/256). It is an IllegalArgumentException — a misconfigured key is a programming/configuration error caught once at construction, not a per-message runtime failure — so a caller need not declare it on the Cipher construction site.
See Also:
  • Constructor Details

    • InvalidKeySizeException

      public InvalidKeySizeException(int actualBytes)
      Parameters:
      actualBytes - the rejected key length, in bytes