Documentation
¶
Index ¶
- Constants
- Variables
- type Key
- type KeyPair
- func (kp KeyPair) Bytes() []byte
- func (kp KeyPair) Decrypt(msg, eph, nonce, aad []byte) (plaintext []byte, err error)
- func (kp KeyPair) GenerateSharedSecret(randomness io.Reader, pubKey PublicKey) (sharedSecret []byte, ephemeralPubKey []byte, err error)
- func (kp KeyPair) MarshalJSON() ([]byte, error)
- func (kp KeyPair) MustBeValid()
- func (kp KeyPair) PrivateKey() PrivateKey
- func (kp KeyPair) PrivateSigningKey() Key
- func (kp KeyPair) Public() crypto.PublicKey
- func (kp KeyPair) PublicKey() PublicKey
- func (kp KeyPair) Seal(sec []byte, plainText []byte, nonce []byte, aad []byte) ([]byte, error)
- func (kp KeyPair) Sign(_ io.Reader, digest []byte, _ crypto.SignerOpts) ([]byte, error)
- func (kp KeyPair) String() string
- func (kp *KeyPair) UnmarshalJSON(data []byte) error
- func (kp KeyPair) Verify(pubKey crypto.PublicKey, digest []byte, signature []byte) bool
- func (kp *KeyPair) Write(p []byte) (int, error)
- type PrivateKey
- type PublicKey
- func (k PublicKey) Bytes() []byte
- func (k PublicKey) Encryption() SubKey
- func (p PublicKey) Equal(k crypto.PublicKey) bool
- func (k PublicKey) MarshalJSON() ([]byte, error)
- func (k PublicKey) Nickname() string
- func (k PublicKey) Signing() SubKey
- func (k PublicKey) String() string
- func (k *PublicKey) UnmarshalJSON(data []byte) error
- func (k *PublicKey) Write(p []byte) (int, error)
- type SubKey
Constants ¶
View Source
const GlobalSalt = "oracle/v2"
Variables ¶
View Source
var ErrWrongSize = errors.New("wrong size")
View Source
var ErrZeroKey = errors.New("zero key")
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key [2]SubKey
A Key is either public or private. It combines encryption and signing sub-keys
var ZeroKey Key
func KeyFromBytes ¶
func KeyFromString ¶
func (Key) MarshalJSON ¶
func (Key) MustBeValid ¶
func (k Key) MustBeValid()
func (*Key) UnmarshalJSON ¶
type KeyPair ¶
type KeyPair [2]Key
var ZeroKeyPair KeyPair
func NewKeyPair ¶
NewKeyPair generates valid ed25519 and X25519 keys
func (KeyPair) GenerateSharedSecret ¶
func (KeyPair) MarshalJSON ¶
func (KeyPair) MustBeValid ¶
func (kp KeyPair) MustBeValid()
func (KeyPair) PrivateKey ¶
func (kp KeyPair) PrivateKey() PrivateKey
func (KeyPair) PrivateSigningKey ¶
A PrivateSigningKey contains both private and public key material. That's just how ed25519 works
func (*KeyPair) UnmarshalJSON ¶
type PrivateKey ¶
type PrivateKey Key
func (PrivateKey) Bytes ¶
func (k PrivateKey) Bytes() []byte
func (PrivateKey) Encryption ¶
func (k PrivateKey) Encryption() SubKey
func (PrivateKey) Signing ¶
func (k PrivateKey) Signing() SubKey
type PublicKey ¶
type PublicKey Key
func (PublicKey) Encryption ¶
func (PublicKey) MarshalJSON ¶
func (PublicKey) Nickname ¶
A Nickname is a very memorable string for humans only. It has weak uniqueness that is good enough for some uses.
func (*PublicKey) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.