Documentation
¶
Overview ¶
Package secrets manages secret keys used in onion clients and servers.
Index ¶
- type ClientKeyPair
- type ClientPublic
- type ClientsPublic
- type Secrets
- func (s *Secrets) ClientsPublic() ClientsPublic
- func (s *Secrets) EnsureClientKey(name string) (ClientKeyPair, error)
- func (s *Secrets) EnsureServiceKey(name string) ([]byte, error)
- func (s *Secrets) RemoveClientKey(name string) error
- func (s *Secrets) RemoveServiceKey(name string) error
- func (s *Secrets) ResolveClientPrivateKey(nameOrKey string) ([]byte, error)
- func (s *Secrets) ServicesPublic() ServicesPublic
- func (s *Secrets) WriteFile() error
- type ServicePublic
- type ServicesPublic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientKeyPair ¶
ClientKeyPair represents an x25519 key pair used for client authorization.
type ClientPublic ¶
type ClientPublic struct {
Identity string `json:"identity"`
}
ClientPublic represents a client public key identity, that can be authorized to access onion services.
type ClientsPublic ¶
type ClientsPublic map[string]ClientPublic
ClientsPublic represent client public key identities that can be authorized to access onion services.
type Secrets ¶
type Secrets struct { Version string `json:"version"` ServiceKeys map[string][]byte `json:"serviceKeys"` ClientKeys map[string]ClientKeyPair `json:"clientKeys"` // contains filtered or unexported fields }
Secrets represents the format for storing onionpipe secret keys.
func (*Secrets) ClientsPublic ¶
func (s *Secrets) ClientsPublic() ClientsPublic
ClientsPublic returns public key information about the client identities held in this secret store. Clients' public keys would be shared with the operator of an authenticated onion service, for granting exclusive access to these key identities.
func (*Secrets) EnsureClientKey ¶
func (s *Secrets) EnsureClientKey(name string) (ClientKeyPair, error)
EnsureClientKey returns the client private key for the given alias name, generating a new one if it did not exist.
func (*Secrets) EnsureServiceKey ¶
EnsureServiceKey returns the service private key for the given alias name, generating a new one if it did not exist.
func (*Secrets) RemoveClientKey ¶
RemoveClientKey removes the client private key for the given alias name.
func (*Secrets) RemoveServiceKey ¶
RemoveServiceKey removes the service private key for the given alias name.
func (*Secrets) ResolveClientPrivateKey ¶
ResolveClientPrivateKey returns the x25519 client authorization private key for the given identity name, or base32-encoded private key representation.
func (*Secrets) ServicesPublic ¶
func (s *Secrets) ServicesPublic() ServicesPublic
ServicesPublic returns public key information about the service keys.
type ServicePublic ¶
type ServicePublic struct {
Address string `json:"address"`
}
ServicePublic represents public key information about a service.
type ServicesPublic ¶
type ServicesPublic map[string]ServicePublic
ServicesPublic represent public key information about services.