AESServerCipher

The AESServerCipher class is useful for server side applications for "AES"'s encryption or decryption

Author

Tecknobit N7ghtm4r3

Since

2.0.2

See also

Constructors

Link copied to clipboard
constructor(ivParameterSpec: IvParameterSpec, secretKey: SecretKey, algorithm: BaseCipher.Algorithm)
Constructor to init AESServerCipher
constructor(ivParameterSpec: String, secretKey: String, algorithm: BaseCipher.Algorithm)
Constructor to init AESServerCipher

Types

Link copied to clipboard
AESKeySize list of available key sizes

Properties

Link copied to clipboard
AES_ALGORITHM_TYPE is constant that memorizes algorithm type used for the cipher
Link copied to clipboard
protected open var algorithm: BaseCipher.Algorithm
algorithm used during the encryption and the decryption phases
Link copied to clipboard
protected val cipher: Cipher
cipher to manage the encryption and the decryption phases
Link copied to clipboard
protected open var ivParameterSpec: IvParameterSpec
ivParameterSpec is instance that memorizes initialization vector used for the cipher
Link copied to clipboard
protected open var secretKey: SecretKey
secretKey is instance that memorizes secret key used for the cipher

Functions

Link copied to clipboard
This method is used to create an initialization vector No-any params required
Link copied to clipboard
This method is used to create a secret key
Link copied to clipboard
open fun createIvParameter(ivParameter: String): IvParameterSpec
This method is used to create an initialization vector from a String object
Link copied to clipboard
This method is used to create an initialization vector No-any params required
Link copied to clipboard
open fun createSecretKey(secretKey: String): SecretKey
This method is used to create a secret key from a String object
This method is used to create a secret key
Link copied to clipboard
open fun decodeBase64(source: String): Array<Byte>
Method to decode a Base64 source
Link copied to clipboard
open fun decrypt(content: Array<Byte>): Array<Byte>
Method to decrypt a content
Link copied to clipboard
open fun decryptBase64(content: String): String
Method to decrypt a Base64 content
Link copied to clipboard
open fun encodeBase64(source: Array<Byte>): String
open fun encodeBase64(source: String): String
Method to encode in Base64 a source
Link copied to clipboard
open fun <T> encrypt(content: T): Array<Byte>
Method to encrypt any content
Link copied to clipboard
open fun <T> encryptBase64(content: T): String
Method to encrypt and format in Base64 any content
Link copied to clipboard
Method to get algorithm instance No-any params required
Link copied to clipboard
This method is used to get ivParameterSpec instance as String No-any params required
Link copied to clipboard
This method is used to get secretKey instance as String No-any params required
Link copied to clipboard
open fun getCipher(): Cipher
Method to get cipher instance No-any params required
Link copied to clipboard
This method is used to get ivParameterSpec instance No-any params required
Link copied to clipboard
This method is used to get secretKey instance No-any params required
Link copied to clipboard
open fun setAlgorithm(algorithm: BaseCipher.Algorithm)
Method to set algorithm instance
Link copied to clipboard
open fun setIvParameterSpec(ivParameterSpec: String)
open fun setIvParameterSpec(ivParameterSpec: IvParameterSpec)
This method is used to set the ivParameterSpec instance
Link copied to clipboard
open fun setSecretKey(secretKey: String)
open fun setSecretKey(secretKey: SecretKey)
This method is used to set the secretKey instance
Link copied to clipboard
open fun toString(): String
Returns a string representation of the object No-any params required