Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyResolver ¶ added in v0.1.1
type KeyResolver struct {
// contains filtered or unexported fields
}
KeyResolver resolves the public key for an ActivityPub actor.
func NewKeyResolver ¶ added in v0.1.1
func NewKeyResolver(actorRetriever actorRetriever) *KeyResolver
NewKeyResolver returns a new KeyResolver.
func (*KeyResolver) Resolve ¶ added in v0.1.1
func (r *KeyResolver) Resolve(keyID string) (*ariesverifier.PublicKey, error)
Resolve returns the public key for the given key ID.
type SecretRetriever ¶ added in v0.1.1
type SecretRetriever struct{}
SecretRetriever implements a custom key retriever to be used with the HTTP signature library.
type SignatureHashAlgorithm ¶ added in v0.1.1
type SignatureHashAlgorithm struct { Crypto crypto KMS keyManager // contains filtered or unexported fields }
SignatureHashAlgorithm is a custom httpsignatures.SignatureHashAlgorithm that uses KMS to sign HTTP requests.
func NewSignerAlgorithm ¶ added in v0.1.1
func NewSignerAlgorithm(c crypto, km keyManager, keyID string) *SignatureHashAlgorithm
NewSignerAlgorithm returns a new SignatureHashAlgorithm which uses KMS to sign HTTP requests.
func NewVerifierAlgorithm ¶ added in v0.1.1
func NewVerifierAlgorithm(c crypto, km keyManager, keyResolver keyResolver) *SignatureHashAlgorithm
NewVerifierAlgorithm returns a new SignatureHashAlgorithm which is used to verify the signature in the HTTP request header.
func (*SignatureHashAlgorithm) Algorithm ¶ added in v0.1.1
func (a *SignatureHashAlgorithm) Algorithm() string
Algorithm returns this algorithm's name.
type Signer ¶
type Signer struct { SignerConfig // contains filtered or unexported fields }
Signer signs HTTP requests.
func NewSigner ¶
func NewSigner(cfg SignerConfig, cr crypto, km keyManager, keyID string) *Signer
NewSigner returns a new signer.
type SignerConfig ¶
type SignerConfig struct {
Headers []string
}
SignerConfig contains the configuration for signing HTTP requests.
func DefaultGetSignerConfig ¶
func DefaultGetSignerConfig() SignerConfig
DefaultGetSignerConfig returns the default configuration for signing HTTP GET requests.
func DefaultPostSignerConfig ¶
func DefaultPostSignerConfig() SignerConfig
DefaultPostSignerConfig returns the default configuration for signing HTTP POST requests.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier verifies signatures of HTTP requests.
func NewVerifier ¶
func NewVerifier(actorRetriever actorRetriever, cr crypto, km keyManager) *Verifier
NewVerifier returns a new HTTP signature verifier.
func (*Verifier) VerifyRequest ¶
VerifyRequest verifies the following: - HTTP signature on the request. - Ensures that the key ID in the request header is owned by the actor.
Returns: - true if the signature was successfully verified, otherwise false. - Actor IRI if the signature was successfully verified. - An error if the signature could not be verified due to server error.