Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSignature = errors.New("invalid HTTP signature")
ErrInvalidSignature indicates that the signature is not valid for the given data.
Functions ¶
This section is empty.
Types ¶
type SecretRetriever ¶
type SecretRetriever struct{}
SecretRetriever implements a custom key retriever to be used with the HTTP signature library.
type SignatureHashAlgorithm ¶
type SignatureHashAlgorithm struct {
// contains filtered or unexported fields
}
SignatureHashAlgorithm is a custom httpsignatures.SignatureHashAlgorithm that uses ed25519 key to sign HTTP requests.
func NewSignerAlgorithm ¶
func NewSignerAlgorithm(privateKey ed25519.PrivateKey) *SignatureHashAlgorithm
NewSignerAlgorithm returns a new SignatureHashAlgorithm which uses ed25519 key to sign HTTP requests.
func NewVerifierAlgorithm ¶
func NewVerifierAlgorithm(pubKeyResolver keyResolver) *SignatureHashAlgorithm
NewVerifierAlgorithm returns a new SignatureHashAlgorithm which is used to verify the signature in the HTTP request header.
func (*SignatureHashAlgorithm) Algorithm ¶
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, privateKey ed25519.PrivateKey) *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(pubKeyResolver keyResolver) *Verifier
NewVerifier returns a new HTTP signature verifier.
func (*Verifier) VerifyRequest ¶
VerifyRequest verifies the following: - HTTP signature on the request.
Returns: - true if the signature was successfully verified, otherwise false. - Subject DID if the signature was successfully verified.