Companion

actual object Companion(source)
actual object Companion(source)
expect object Companion(source)
actual object Companion(source)
actual object Companion(source)

Properties

Functions

Link copied to clipboard
actual fun createIdentity(isServer: Boolean, attributes: Map<String, String>, expiration: Instant?, alias: String): TLSIdentity
fun createIdentity(identity: SecIdentityRef, certs: List<SecCertificateRef>?): TLSIdentity

Get an identity with a SecIdentity object. Any intermediate or root certificates required to identify the certificate but not present in the system-wide set of trusted anchor certificates need to be specified in the optional certs parameter. In addition, the specified SecIdentity object is required to be present in the KeyChain, otherwise an exception will be thrown.

actual fun createIdentity(isServer: Boolean, attributes: Map<String, String>, expiration: Instant?, alias: String): TLSIdentity
expect fun createIdentity(isServer: Boolean, attributes: Map<String, String>, expiration: Instant?, alias: String): TLSIdentity

Create self-signed certificate and private key, store them in the canonical keystore, and return an identity backed by the new entry. The identity will be stored in the secure storage using the specified alias and can be recovered using that alias, after this method returns.

actual fun createIdentity(isServer: Boolean, attributes: Map<String, String>, expiration: Instant?, alias: String): TLSIdentity
fun createIdentity(    isServer: Boolean,     attributes: Map<String, String>,     expiration: Instant?,     keyStore: KeyStore,     alias: String,     keyPassword: CharArray?): TLSIdentity

Create a self-signed certificate TLSIdentity object. The generated private key will be stored in the KeyStore along with its self-signed certificate.

actual fun createIdentity(isServer: Boolean, attributes: Map<String, String>, expiration: Instant?, alias: String): TLSIdentity
Link copied to clipboard
actual fun deleteIdentity(alias: String)
actual fun deleteIdentity(alias: String)
expect fun deleteIdentity(alias: String)

Delete the identity in the keystore with the given alias.

actual fun deleteIdentity(alias: String)
actual fun deleteIdentity(alias: String)
Link copied to clipboard
actual fun getIdentity(alias: String): TLSIdentity?
actual fun getIdentity(alias: String): TLSIdentity?
expect fun getIdentity(alias: String): TLSIdentity?

Get a TLSIdentity backed by the information for the passed alias.

actual fun getIdentity(alias: String): TLSIdentity?
fun getIdentity(keyStore: KeyStore, alias: String, keyPassword: CharArray?): TLSIdentity?

Get a TLSIdentity object from the give KeyStore, key alias, and key password. The KeyStore must contain the private key along with the certificate chain at the given key alias and password, otherwise null will be returned.

actual fun getIdentity(alias: String): TLSIdentity?
Link copied to clipboard
fun importIdentity(data: ByteArray, password: CharArray?, alias: String): TLSIdentity

Imports and creates an identity from the given PKCS12 Data. The imported identity will be stored in the Keychain with the given alias.

Link copied to clipboard
fun useKeyStore(keyStore: KeyStore, keyPassword: CharArray? = null)

Register a KeyStore and key password to use in common APIs.