moonbit-community/rtc/dtls does not have a README file
pub struct CertificateIdentity {
provider : Provider
private_key : PrivateKey
certificate : Certificate
certificate_der : Bytes
key_type : CertificateKeyType
}fn CertificateIdentity::fingerprint(self : CertificateIdentity, algorithm? : FingerprintAlgorithm) -> Fingerprint raise DtlsErrorfn CertificateIdentity::generate(common_name? : String, key_type? : CertificateKeyType, not_before~ : WallTime, not_after~ : WallTime) -> CertificateIdentity raise DtlsErrorpub struct ClientHelloMessage {
random : Bytes
session_id : Bytes
cookie : Bytes
cipher_suites : Array[UInt16]
compression_methods : Array[Byte]
extensions : HelloExtensions
} derive(Eq, Debug)fn ClientHelloMessage::new(random~ : Bytes, cookie? : Bytes, cipher_suites? : Array[CipherSuite], extensions~ : HelloExtensions) -> ClientHelloMessage raise DtlsErrorpub struct Config {
role : Role
identity : CertificateIdentity
expected_peer_fingerprint : Fingerprint
wall_time : WallTime
cipher_suites : Array[CipherSuite]
psk : Bytes?
psk_identity : Bytes?
srtp_profiles : Array[SrtpProtectionProfile]
flight_interval : Duration
mtu : Int
replay_window : Int
verify_peer_fingerprint : Bool
}fn Config::new(role~ : Role, identity~ : CertificateIdentity, expected_peer_fingerprint~ : Fingerprint, wall_time~ : WallTime, cipher_suites? : Array[CipherSuite], psk? : Bytes, psk_identity? : Bytes, srtp_profiles? : Array[SrtpProtectionProfile], flight_interval? : Duration, mtu? : Int, replay_window? : Int, verify_peer_fingerprint? : Bool) -> Config raise DtlsErrorpub(all) enum DtlsEvent {
StateChanged(State)
ConnectedWithSrtp(SrtpProtectionProfile?)
ApplicationDataReceived(Bytes)
AlertReceived(AlertLevel, AlertDescription)
} derive(Eq, Debug)pub struct Endpoint {
config : Config
provider : Provider
outputs : Queue[Bytes]
events : Queue[DtlsEvent]
state : State
phase : HandshakePhase
fragments : FragmentBuffer
transcript : Array[Bytes]
local_handshake_sequence : UInt16
epoch_zero_sequence : UInt64
epoch_one_sequence : UInt64
client_random : Bytes?
server_random : Bytes?
initial_client_hello : Bytes?
cookie : Bytes?
local_ephemeral : PrivateKey?
peer_ephemeral : PublicKey?
peer_certificate_key : PublicKey?
master_secret : Secret?
cipher : RecordCipher?
selected_cipher_suite : CipherSuite?
selected_srtp_profile : SrtpProtectionProfile?
certificate_requested : Bool
client_server_stage : Int
server_client_stage : Int
peer_changed_cipher_spec : Bool
last_flight : Array[Bytes]
retransmit_deadline : Instant?
retransmit_interval_milliseconds : Int64
retransmissions : Int
}fn Fingerprint::new(algorithm~ : FingerprintAlgorithm, value~ : Bytes) -> Fingerprint raise DtlsErrorpub struct HandshakeFragment {
handshake_type : HandshakeType
total_length : UInt
message_sequence : UInt16
fragment_offset : UInt
body : Bytes
} derive(Eq, Debug)fn HandshakeFragment::new(handshake_type~ : HandshakeType, total_length~ : UInt, message_sequence~ : UInt16, fragment_offset~ : UInt, body~ : Bytes) -> HandshakeFragment raise DtlsErrorpub(all) enum HandshakeMessage {
ClientHelloHandshake(ClientHelloMessage)
ServerHelloHandshake(ServerHelloMessage)
HelloVerifyRequestHandshake(HelloVerifyRequestMessage)
CertificateHandshake(CertificateMessage)
ServerKeyExchangeHandshake(ServerKeyExchangeMessage)
CertificateRequestHandshake(CertificateRequestMessage)
ServerHelloDoneHandshake
CertificateVerifyHandshake(CertificateVerifyMessage)
ClientKeyExchangeHandshake(ClientKeyExchangeMessage)
FinishedHandshake(FinishedMessage)
} derive(Eq, Debug)fn HandshakeMessage::to_fragment(self : HandshakeMessage, message_sequence : UInt16) -> HandshakeFragment raise DtlsErrorfn Record::new(content_type~ : ContentType, version? : ProtocolVersion, epoch~ : UInt16, sequence_number~ : UInt64, payload~ : Bytes) -> Record raise DtlsErrorpub struct RecordHeader {
content_type : ContentType
version : ProtocolVersion
epoch : UInt16
sequence_number : UInt64
content_length : UInt16
} derive(Eq, Debug)fn RecordHeader::new(content_type~ : ContentType, version? : ProtocolVersion, epoch~ : UInt16, sequence_number~ : UInt64, content_length~ : UInt16) -> RecordHeader raise DtlsErrorpub struct ServerHelloMessage {
random : Bytes
session_id : Bytes
cipher_suite : UInt16
compression_method : Byte
extensions : HelloExtensions
} derive(Eq, Debug)fn ServerHelloMessage::new(random~ : Bytes, cipher_suite? : CipherSuite, selected_srtp_profile? : UInt16) -> ServerHelloMessage raise DtlsErrorInstall
Download zipExperimental Sans-I/O WebRTC stack for MoonBit
Dependencies