If I needed to reference an encoding, like UTF-8, I'd typically reference the StandardCharset.UTF-8
static, not use a String literal "UTF-8"
.
When working with cipher transformations, I see everywhere that transformations are given as String literals, like Cipher.getInstance("AES")
or Cipher.getInstance("AES/CBC/PKCS5Padding")
, and occasionally, there's a typo.
Which class can I use for statics of cipher algorithm names, modes and paddings? Does one exist?
For reference, list of permitted names/modes/paddings in the docs.