Documentation
¶
Index ¶
- Constants
- Variables
- func KeyFromBytes(b []byte) key
- func NewKey(randy io.Reader) key
- func NewKeyPair(randy io.Reader) keyPair
- func NewPrincipal(randy io.Reader) *principal
- func NewSubKey(randy io.Reader) subKey
- type Certifier
- type Cipherer
- type CryptOpts
- type Decrypter
- type Encrypter
- type EncrypterOpts
- type Message
- func (msg *Message) Digest(hash hash.Hash) ([]byte, error)
- func (msg *Message) Encrypt(randy io.Reader, encrypter Encrypter, opts EncrypterOpts) error
- func (msg *Message) Encrypted() bool
- func (m *Message) Ephemeral() crypto.PublicKey
- func (m *Message) From() crypto.PublicKey
- func (m *Message) MarshalBinary() ([]byte, error)
- func (msg *Message) Plain() bool
- func (msg *Message) Sign(randy io.Reader, signer crypto.Signer) error
- func (m *Message) Signatory() crypto.PublicKey
- func (m *Message) Signature() []byte
- func (m *Message) To() crypto.PublicKey
- func (m *Message) UnmarshalBinary(p []byte) error
- func (msg *Message) Valid() bool
- 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 ErrBadKey = errors.New("bad key")
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 NewKeyPair ¶ added in v0.0.4
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
}
a Cipherer can encrypt and decrypt a [message]
type Decrypter ¶ added in v0.0.4
type Decrypter interface {
Decrypt(*Message, ed25519.PrivateKey, crypto.DecrypterOpts) error
}
type EncrypterOpts ¶ added in v0.0.4
type EncrypterOpts = any
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) Encrypt ¶
msg.Encrypt(Encrypter) is another way of doing encrypter.Encrypt(*Message)
func (*Message) MarshalBinary ¶ added in v0.0.4
func (*Message) Sign ¶ added in v0.0.3
msg.Sign(Signer) is another way of doing signer.Sign(*Message)
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.