mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-12-07 11:22:58 +01:00
keyer: move interfaces to toplevel "nostr" package.
This commit is contained in:
20
keyer.go
Normal file
20
keyer.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package nostr
|
||||
|
||||
import "context"
|
||||
|
||||
type Keyer interface {
|
||||
Signer
|
||||
Cipher
|
||||
}
|
||||
|
||||
// A Signer provides basic public key signing methods.
|
||||
type Signer interface {
|
||||
GetPublicKey(context.Context) (string, error)
|
||||
SignEvent(context.Context, *Event) error
|
||||
}
|
||||
|
||||
// A Cipher provides NIP-44 encryption and decryption methods.
|
||||
type Cipher interface {
|
||||
Encrypt(ctx context.Context, plaintext string, recipientPublicKey string) (base64ciphertext string, err error)
|
||||
Decrypt(ctx context.Context, base64ciphertext string, senderPublicKey string) (plaintext string, err error)
|
||||
}
|
||||
Reference in New Issue
Block a user