Scoop API

scoop:scoop.tls:0.1.0

TlsEngine

class TlsEngine

source · line 44
public
public class TlsEngine private constructor(private var handle: ULong) : Closeable

A transport-independent TLS state machine with explicit ciphertext input and output. The caller drives handshake, transfer, verification, and shutdown steps and serializes access to the engine. Close it to release the native session.

function handshake

source · line 94
public
public fun handshake(): TlsStep

Advances the handshake once and reports whether to feed input, drain output, or perform certificate verification.

function takeVerification

source · line 105
public
@Unsafe public fun takeVerification(): Ptr<Unit>

Takes the pending native verification work. Run it, complete it on this engine, and release it exactly once; keep the pointer valid throughout those operations.

function shutdown

source · line 99
public
public fun shutdown(): TlsStep

Advances the TLS close handshake once. The caller continues driving the indicated transport or verification work.

property inputCapacity

source · line 68
public
public val inputCapacity: Long

get: public read-only

The number of additional ciphertext bytes the engine can currently accept.

function close

source · line 187
public
public override fun close(): Unit

Releases the native session without driving a network shutdown. Repeated closes are allowed.

function completeVerification

source · line 112
public
@Unsafe public fun completeVerification(work: Ptr<Unit>): Unit

Applies the result of completed verification work to this engine. The caller still owns and must release the work record.

function verify

source · line 120
public
public fun verify(): Unit

Runs pending certificate verification synchronously, applies its result, and releases the native work record even on failure.

property pendingOutput

source · line 72
public
public val pendingOutput: Long

get: public read-only

The ciphertext byte count available for draining to the transport.

function endInput

source · line 183
public
public fun endInput(): Unit

Marks the ciphertext transport as ended so subsequent steps can distinguish an orderly TLS close from truncation.