Documentation
¶
Index ¶
- Variables
- type Keystore
- type RESTKeystore
- func (ks *RESTKeystore) GetPubKeys() (map[string]*rsa.PublicKey, error)
- func (ks *RESTKeystore) GetSigningKey() (*rsa.PrivateKey, string, error)
- func (ks *RESTKeystore) SetKeyPair(keyID string, keyPair *rsa.PrivateKey, lifespan time.Duration) error
- func (ks *RESTKeystore) SharePubKeyHandler(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
//RESTkeystoreURL is our keystore service URL
RESTkeystoreURL = "http://keystore.us-west-2.adrianosela.com"
)
Functions ¶
This section is empty.
Types ¶
type Keystore ¶
type Keystore interface { SetKeyPair(string, *rsa.PrivateKey, time.Duration) error GetPubKeys() (map[string]*rsa.PublicKey, error) GetSigningKey() (*rsa.PrivateKey, string, error) }
Keystore represents an interface capable of storing and fetching public Keys
type RESTKeystore ¶
type RESTKeystore struct { sync.RWMutex //inherit read/write lock behavior HTTPClient http.Client CachedKeys map[string]*api.KeyMetadata `json:"keys"` SigningKey *rsa.PrivateKey SigningKeyID string }
RESTKeystore is a client of my own REST keystore found in github.com/adrianosela/Keystore
func NewRESTKeystore ¶
func NewRESTKeystore() (*RESTKeystore, error)
NewRESTKeystore returns the addr of a new keystore object
func (*RESTKeystore) GetPubKeys ¶
func (ks *RESTKeystore) GetPubKeys() (map[string]*rsa.PublicKey, error)
func (*RESTKeystore) GetSigningKey ¶
func (ks *RESTKeystore) GetSigningKey() (*rsa.PrivateKey, string, error)
GetSigningKey returns the signing key along its ID and nil error if success
func (*RESTKeystore) SetKeyPair ¶
func (ks *RESTKeystore) SetKeyPair(keyID string, keyPair *rsa.PrivateKey, lifespan time.Duration) error
SavePubKey will cache a given key locally as well as publish it to the RESTKeystore
func (*RESTKeystore) SharePubKeyHandler ¶
func (ks *RESTKeystore) SharePubKeyHandler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.