RSAServerCipher

The RSAServerCipher class is useful for server side applications for "RSA"'s encryption or decryption

Author

Tecknobit N7ghtm4r3

Since

2.1.5

See also

Constructors

Link copied to clipboard
constructor(privateKey: String, publicKey: String)
Constructor to init a RSAServerCipher object
constructor(keyPair: KeyPair)
Constructor to init a RSAServerCipher object
constructor(privateKey: PrivateKey, publicKey: PublicKey)
Constructor to init a RSAServerCipher object

Types

Link copied to clipboard
RSAKeyStrength list of available key strengths

Properties

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
private open var keyPairMatrix: KeyPair
keyPairMatrix used to generate and manage the keys of the same pair
Link copied to clipboard
protected open var privateKey: PrivateKey
privateKey the private key used to decrypt the content
Link copied to clipboard
protected open var publicKey: PublicKey
publicKey the public key used to encrypt the content

Functions

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 generate an RSA private key
Link copied to clipboard
Method to generate an RSA public key No-any params required
Link copied to clipboard
Method to generate an RSA private key
Link copied to clipboard
Method to generate an RSA public key No-any params required
Link copied to clipboard
Method to generate the RSA key pair
Link copied to clipboard
Method to get algorithm instance No-any params required
Link copied to clipboard
Method to get privateKey instance No-any params required
Link copied to clipboard
Method to get publicKey instance 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
Method to get privateKey instance No-any params required
Link copied to clipboard
Method to get publicKey instance No-any params required
Link copied to clipboard
open fun <T : Key?> recreateKey(key: String, isPrivateKey: Boolean): T
Method to recreate from a String source a key
Link copied to clipboard
open fun setAlgorithm(algorithm: BaseCipher.Algorithm)
Method to set algorithm instance
Link copied to clipboard
open fun setKeys(keyPair: KeyPair)
open fun setKeys(privateKey: String, publicKey: String)
open fun setKeys(privateKey: PrivateKey, publicKey: PublicKey)
Method to set the keys
Link copied to clipboard
open fun setPrivateKey(privateKey: String)
open fun setPrivateKey(privateKey: PrivateKey)
Method to set privateKey instance
Link copied to clipboard
open fun setPublicKey(publicKey: String)
open fun setPublicKey(publicKey: PublicKey)
Method to set publicKey instance
Link copied to clipboard
open fun toString(): String
Returns a string representation of the object No-any params required