io.sureshg.extn

Package io.sureshg.extn

Types

AnsiColor

enum class AnsiColor

ANSI color/graphics extension functions.

BuildInfo

enum class BuildInfo

Common build info attributes

JSSEProp

enum class JSSEProp

JSSE system properties for customization.

KeyStoreType

enum class KeyStoreType

Java KeyStore types.

Platform

object Platform

A platform is a unique combination of CPU architecture and operating system. This class attempts to determine the platform it is executing on by examining and normalizing the os.arch and os.name system properties.

SavingTrustManager

class SavingTrustManager : X509TrustManager

An X509TrustManager to save the server/client cert chains.

Type Aliases

AnsiEsc

typealias AnsiEsc = String

Extensions for External Classes

java.io.File

java.net.URI

java.nio.file.Path

java.security.KeyStore

java.security.cert.X509Certificate

java.util.jar.Attributes

javax.net.ssl.SSLSession

javax.net.ssl.X509TrustManager

javax.security.auth.x500.X500Principal

kotlin.Any

kotlin.Array

kotlin.Byte

kotlin.ByteArray

kotlin.CharArray

kotlin.Int

kotlin.IntArray

kotlin.Long

kotlin.String

kotlin.Throwable

kotlin.collections.List

kotlin.reflect.KClass

Properties

CACerts

val CACerts: String

Returns the file name of the default JDK CA trust store.

CACertsKeyStore

val CACertsKeyStore: KeyStore

Returns the default JDK CA trust store.

ESC

const val ESC: AnsiEsc

Escape unicode in hex.

ESC_END

val ESC_END: AnsiEsc

0 is reset for all

FILE_SEP

val FILE_SEP: String

LINE_SEP

val LINE_SEP: String

PemCertPattern

val PemCertPattern: Regex

PEM regex pattern for cert and private key (Header + Base64 Text + Footer)

PemKeyPattern

val PemKeyPattern: Regex

RAND

val RAND: Random

Random number generator.

SPACE

const val SPACE: String

Common extension functions.

ip_regex

val ip_regex: Regex

IPV4 regex pattern

isTTY

val isTTY: Boolean

Returns true if you are running in a terminal.

Functions

esc

fun esc(vararg codes: Int): AnsiEsc

Returns an ANSI escape unicode from a list of integers.

exit

fun exit(status: Int, msg: () -> String = null): Unit

Exits the system with msg

getSSLContext

fun getSSLContext(protocol: String = "Default", keyManagers: Array<out X509KeyManager>? = null, trustManagers: Array<out X509TrustManager>? = null, secureRandom: SecureRandom? = null): SSLContext

Returns a SSLContext instance for given protocol and X509 key and trust store managers. TrustManagers decide whether to allow connections and KeyManagers decide which key material to use.

main

fun main(args: Array<String>): Unit