keyer: move interfaces to toplevel "nostr" package.

This commit is contained in:
fiatjaf
2024-10-14 16:25:24 -03:00
parent 9057b1a7e1
commit ee5ca07d6d
3 changed files with 52 additions and 17 deletions
+25
View File
@@ -0,0 +1,25 @@
package keyer
import (
"context"
"github.com/nbd-wtf/go-nostr"
)
// Deprecated: use nostr.Keyer instead
type Keyer interface {
Signer
Cipher
}
// Deprecated: use nostr.Signer instead
type Signer interface {
GetPublicKey(context.Context) (string, error)
SignEvent(context.Context, *nostr.Event) error
}
// Deprecated: use nostr.Cipher instead
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)
}