A twisted curve is a spiral.
spiral is a collection of elliptic-curve-backed protocol implementations. At the moment, this is limited to DNSCurve and CurveCP.
Note: spiral is still experimental in general; no guarantees are made about the continued existence of APIs.
DNSCurve support is experimental and requires a currently-unmerged branch of Twisted. Client recursive and nonrecursive resolvers have been implemented; there is currently no DNSCurve server support.
CurveCP support comes in two forms:
curvecpmclient and curvecpmserver are UCSPI-style executables. curvecpmclient will connect to a given CurveCP server and spawn a process to communicate with it. curvecpmserver will listen on a particular port and spawn a process for each incoming connection.
Two standard twisted endpoints are exposed for writing clients or servers in python: CurveCPClientEndpoint and CurveCPServerEndpoint.
An IStreamClientEndpoint implementer for CurveCP clients.
Parameters: |
|
---|
Connect to a CurveCP host.
Parameters: | fac – An IProtocolFactory provider whose buildProtocol returns an IHalfCloseableProtocol provider. |
---|
An IStreamServerEndpoint implementer for CurveCP servers.
All incoming connections are accepted; for filtering based on client/server extension or server DNS name, please override buildProtocol to make decisions about the ICurveCPAddress provider passed to it.
Parameters: |
|
---|
Listen for incoming CurveCP connections.
Parameters: | fac – An IProtocolFactory provider whose buildProtocol returns an IHalfCloseableProtocol provider. |
---|
The 16-byte client extension associated with the connection.
A string representing the server’s DNS name.
The 16-byte server extension associated with the connection.
A nacl.public.PublicKey representing the other side’s long term public key.
The host or IP of the other side of this connection.
The port of the other side of this connection.
A key and nonce generation scheme.
Generate a nonce.
Parameters: | longterm – True to increment the long-term counter; False to increment the short-term counter. |
---|---|
Returns: | 16 bytes. |
A nacl.public.PrivateKey instance.