Documentation
¶
Index ¶
- func GenerateKeys() ([]byte, []byte, error)
- func GetPrivateKey(key string) *rsa.PrivateKey
- type PublicKey
- type Signer
- func (s *Signer) CreateSignedRequest(payload []byte, url *url.URL, fromActorIRI *url.URL, release string) (*http.Request, error)
- func (s *Signer) SignRequest(req *http.Request, body []byte, actorIRI *url.URL) error
- func (s *Signer) SignResponse(w http.ResponseWriter, body []byte, publicKey PublicKey, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
GenerateKeys will generate the private/public key pair needed for federation.
func GetPrivateKey ¶
func GetPrivateKey(key string) *rsa.PrivateKey
GetPrivateKey will return the internal server private key.
Types ¶
type PublicKey ¶
type PublicKey struct { ID *url.URL `json:"id"` Owner *url.URL `json:"owner"` PublicKeyPem string `json:"publicKeyPem"` }
PublicKey represents a public key with associated ownership.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func (*Signer) CreateSignedRequest ¶
func (s *Signer) CreateSignedRequest(payload []byte, url *url.URL, fromActorIRI *url.URL, release string) (*http.Request, error)
CreateSignedRequest will create a signed POST request of a payload to the provided destination.
func (*Signer) SignRequest ¶
SignRequest will sign an ounbound request given the provided body.
func (*Signer) SignResponse ¶
func (s *Signer) SignResponse(w http.ResponseWriter, body []byte, publicKey PublicKey, privateKey *rsa.PrivateKey) error
SignResponse will sign a response using the provided response body and public key.
Click to show internal directories.
Click to hide internal directories.