devp2p / org.apache.tuweni.devp2p.v5.internal / DefaultAuthenticationProvider

DefaultAuthenticationProvider

class DefaultAuthenticationProvider : AuthenticationProvider (source)

Constructors

<init>

DefaultAuthenticationProvider(keyPair: KeyPair, routingTable: RoutingTable)

Functions

authenticate

fun authenticate(handshakeParams: HandshakeInitParameters): AuthHeader

Creates authentication header to initialize handshake process. As a result it creates an authentication header to include to udp message.

finalizeHandshake

fun finalizeHandshake(senderNodeId: Bytes, authHeader: AuthHeader): Unit

Verifies, that incoming authentication header is valid via decoding authorization response and checking nonce signature. In case if everything is valid, it creates and stores session key

findSessionKey

fun findSessionKey(nodeId: String): SessionKey?

Provides session key by node identifier

setSessionKey

fun setSessionKey(nodeId: String, sessionKey: SessionKey): Unit

Persists session key by node identifier