Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Crypto ¶
type Crypto interface { Sign(msg []byte, kh interface{}) ([]byte, error) Verify(sig, msg []byte, kh interface{}) error }
Crypto primitives.
type DIDResolver ¶
type DIDResolver interface { Accept(method string) bool Read(did string, options ...vdr.DIDMethodOption) (*did.DocResolution, error) }
DIDResolver resolves DIDs.
type DIDSecrets ¶
type DIDSecrets struct {
Secrets map[string]httpsignatures.Secrets
}
DIDSecrets only supports DID URLs as key IDs.
func (*DIDSecrets) Get ¶
func (c *DIDSecrets) Get(didURL string) (httpsignatures.Secret, error)
Get resolves the DID URL into a secret.
type DIDSignatureHashAlgorithms ¶
type DIDSignatureHashAlgorithms struct { KMS KMS Crypto Crypto Resolvers []DIDResolver }
DIDSignatureHashAlgorithms is a composition of several DID methods that can create signatures and verify them.
func (*DIDSignatureHashAlgorithms) Algorithm ¶
func (a *DIDSignatureHashAlgorithms) Algorithm() string
Algorithm returns a custom algorithm identifier for the httpsignatures API.
func (*DIDSignatureHashAlgorithms) Create ¶
func (a *DIDSignatureHashAlgorithms) Create(secret httpsignatures.Secret, data []byte) ([]byte, error)
Create a signature over data with the secret.
func (*DIDSignatureHashAlgorithms) Verify ¶
func (a *DIDSignatureHashAlgorithms) Verify(secret httpsignatures.Secret, data, signature []byte) error
Verify the signature over data using the secret.
Click to show internal directories.
Click to hide internal directories.