Documentation ¶
Index ¶
- Constants
- type ApplicationChain
- func (appchain *ApplicationChain) ChainApplication(app tapir.Application, capability tapir.Capability) *ApplicationChain
- func (appchain *ApplicationChain) ChainInteractiveApplication(app tapir.InteractiveApplication) *ApplicationChain
- func (appchain *ApplicationChain) Init(connection tapir.Connection)
- func (appchain *ApplicationChain) Listen()
- func (appchain *ApplicationChain) NewInstance() tapir.Application
- type AuthApp
- type AuthMessage
- type ProofOfWorkApplication
- type TokenApplication
- type TranscriptApp
Constants ¶
const ( PoWApp = "pow-app" PoWSeed = "pow-seed" PoWChallenge = "pow-challenge" PoWPRNG = "pow-prng" PoWSolution = "pow-solution" )
transcript constants
const AuthCapability = tapir.Capability("AuthenticationCapability")
AuthCapability defines the Authentication Capability granted by AuthApp
const HasTokensCapability = tapir.Capability("HasTokensCapability")
HasTokensCapability is granted once the client has obtained signed tokens
const SuccessfulProofOfWorkCapability = tapir.Capability("SuccessfulProofOfWorkCapability")
SuccessfulProofOfWorkCapability is given when a successfully PoW Challenge has been Completed
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationChain ¶
type ApplicationChain struct { TranscriptApp // contains filtered or unexported fields }
ApplicationChain is a meta-app that can be used to build complex applications from other applications
func (*ApplicationChain) ChainApplication ¶
func (appchain *ApplicationChain) ChainApplication(app tapir.Application, capability tapir.Capability) *ApplicationChain
ChainApplication adds a new application to the chain. Returns a pointer to app so this call can itself be chained.
func (*ApplicationChain) ChainInteractiveApplication ¶
func (appchain *ApplicationChain) ChainInteractiveApplication(app tapir.InteractiveApplication) *ApplicationChain
ChainInteractiveApplication adds an interactive application to the chain. There can only be 1 interactive application.
func (*ApplicationChain) Init ¶
func (appchain *ApplicationChain) Init(connection tapir.Connection)
Init is run when the connection is first started.
func (*ApplicationChain) Listen ¶
func (appchain *ApplicationChain) Listen()
Listen calls listen on the Interactive application
func (*ApplicationChain) NewInstance ¶
func (appchain *ApplicationChain) NewInstance() tapir.Application
NewInstance should always return a new instantiation of the application.
type AuthApp ¶
type AuthApp struct {
TranscriptApp
}
AuthApp is the concrete Application type that handles Authentication
func (*AuthApp) Init ¶
func (ea *AuthApp) Init(connection tapir.Connection)
Init runs the entire AuthApp protocol, at the end of the protocol either the connection is granted AUTH capability or the connection is closed.
func (AuthApp) NewInstance ¶
func (ea AuthApp) NewInstance() tapir.Application
NewInstance creates a new instance of the AuthApp
type AuthMessage ¶
type AuthMessage struct { LongTermPublicKey ed25519.PublicKey EphemeralPublicKey ed25519.PublicKey }
AuthMessage is exchanged between peers to obtain the Auth Capability
type ProofOfWorkApplication ¶
type ProofOfWorkApplication struct {
TranscriptApp
}
ProofOfWorkApplication forces the incoming connection to do proof of work before granting a capability
func (*ProofOfWorkApplication) Init ¶
func (powapp *ProofOfWorkApplication) Init(connection tapir.Connection)
Init is run when the connection is first started.
func (*ProofOfWorkApplication) NewInstance ¶
func (powapp *ProofOfWorkApplication) NewInstance() tapir.Application
NewInstance should always return a new instantiation of the application.
type TokenApplication ¶
type TokenApplication struct { TranscriptApp TokenService *privacypass.TokenServer Tokens []*privacypass.Token }
TokenApplication provides Tokens for PoW
func (*TokenApplication) Init ¶
func (tokenapp *TokenApplication) Init(connection tapir.Connection)
Init is run when the connection is first started.
func (*TokenApplication) NewInstance ¶
func (tokenapp *TokenApplication) NewInstance() tapir.Application
NewInstance should always return a new instantiation of the application.
type TranscriptApp ¶
type TranscriptApp struct {
// contains filtered or unexported fields
}
TranscriptApp defines a Tapir Meta-App which provides a global cryptographic transcript
func (*TranscriptApp) Init ¶
func (ta *TranscriptApp) Init(connection tapir.Connection)
Init initializes the cryptographic transcript
func (TranscriptApp) NewInstance ¶
func (TranscriptApp) NewInstance() tapir.Application
NewInstance creates a new TranscriptApp
func (*TranscriptApp) PropagateTranscript ¶
func (ta *TranscriptApp) PropagateTranscript(transcript *core.Transcript)
PropagateTranscript overrides the default transcript and propagates a transcript from a previous session
func (*TranscriptApp) Transcript ¶
func (ta *TranscriptApp) Transcript() *core.Transcript
Transcript returns a pointer to the cryptographic transcript