RSAConverter

open class RSAConverter

Several conversion functions for RSA and PEM keys

Functions

Link copied to clipboard
open fun bytesToPrivateKey(bytes: Array<Byte>): PrivateKey
Convert bytes to an RSA private key.
Link copied to clipboard
open fun bytesToPublicKey(bytes: Array<Byte>): PublicKey
Convert bytes to an RSA public key.
Link copied to clipboard
open fun getBytes(key: PrivateKey): Array<Byte>
Convert a private RSA key to
open fun getBytes(key: PublicKey): Array<Byte>
Convert a public RSA key to
Link copied to clipboard
open fun pemToBytes(pem: String): Array<Byte>
Convert a PEM key to a byte array.
Link copied to clipboard
open fun privateKeyToKeyPair(privateKey: PrivateKey): KeyPair
Convert a private RSA key to a KeyPair with the public key.
Link copied to clipboard
open fun privateToPEM(privateKey: PrivateKey): String
Convert a private RSA key to a PEM key.
Link copied to clipboard
open fun publicToPEM(publicKey: PublicKey): String
Convert a public RSA key to a PEM key.