Documentation
¶
Index ¶
- Constants
- Variables
- func KeyFromBytes(b []byte) key
- func NewPrincipal(randy io.Reader) *principal
- type Certifier
- type Cipherer
- type CryptOpts
- type Encrypter
- type Message
- func (msg *Message) Decrypt(recipientPrivKey *ecdh.PrivateKey) error
- func (msg *Message) Digest() ([]byte, error)
- func (msg *Message) Encrypt(randomness io.Reader) error
- func (msg *Message) IsEncrypted() bool
- func (msg *Message) IsPlain() bool
- func (msg *Message) IsValid() bool
- func (m *Message) MarhsalBinary() ([]byte, error)
- func (msg *Message) Sign(randy io.Reader, signer crypto.Signer) error
- func (m *Message) UnmarshalBinary(p []byte) error
- type Nonce
- type Principal
- type Verifier
Constants ¶
View Source
const ByteSize = 128
View Source
const GLOBAL_SALT = "oracle/v1"
View Source
const NonceSize = chacha20poly1305.NonceSize
Variables ¶
View Source
var ErrDecryptionFailed = errors.New("decryption failed")
View Source
var ErrDelphi = errors.New("delphi")
View Source
var ErrEncryptionFailed = errors.New("encryption failed")
View Source
var ErrNoEphemeralKey = errors.New("no ephemeral key")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var UniversalNonce []byte = make([]byte, chacha20poly1305.NonceSize)
Functions ¶
func KeyFromBytes ¶ added in v0.0.3
func KeyFromBytes(b []byte) key
func NewPrincipal ¶
Types ¶
type Certifier ¶
type Certifier interface { crypto.PrivateKey crypto.Signer Verifier }
a Certifier can produce and verify signatures
type Cipherer ¶
type Cipherer interface { crypto.PrivateKey Encrypter crypto.Decrypter }
a Cipherer can encrypt and decrypt an [Envelope]
type Message ¶
type Message struct { To key From key Metadata *stablemap.StableMap[string, any] // additional authenticated data (AAD) EphemeralPublicKey []byte Nonce Nonce CipherText []byte PlainText []byte Signature []byte }
func (*Message) IsEncrypted ¶ added in v0.0.3
func (*Message) MarhsalBinary ¶
func (*Message) UnmarshalBinary ¶
type Principal ¶
type Principal interface { Cipherer Certifier encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
a Principal is a holder of a public/private key-pair that can perform encryption, decryption, signing, and verifying operations.
Click to show internal directories.
Click to hide internal directories.