Documentation ¶
Index ¶
- Constants
- func AppendToSignedHash(s SignedHash, i Identity) error
- func DecryptBlock(key []byte, nonce []byte, cipherdata []byte) ([]byte, error)
- func EcDecrypt(identity Identity, data []byte) ([]byte, error)
- func EcEncrypt(identity Identity, data []byte) ([]byte, error)
- func EncryptBlock(key []byte, nonce []byte, data []byte) ([]byte, error)
- func GenerateBytesKey(size int) []byte
- func NewHash() hash.Hash
- func SameIdentity(a, b Identity) bool
- func SetIdentity(i Identity) error
- func Sign(identity Identity, data []byte) ([]byte, error)
- func Trust(i Identity, trusted bool) error
- func Verify(id string, data []byte, sig []byte) bool
- func VerifySignedHash(s SignedHash, trusts []Identity, hash []byte) bool
- type HashStream
- type Identity
- type Key
- type PrivateKey
- type Public
- type PublicKey
- type SignedData
- type SignedHash
- type SignedHashEvidence
- type StreamReader
- type StreamWriter
Constants ¶
View Source
const ( Secp256k1 = "secp256k1" Ed25519 = "ed25519" )
View Source
const ( PublicKeySize = ed25519.PublicKeySize PrivateKeySize = ed25519.PrivateKeySize SignatureSize = ed25519.SignatureSize )
Variables ¶
This section is empty.
Functions ¶
func AppendToSignedHash ¶
func AppendToSignedHash(s SignedHash, i Identity) error
func GenerateBytesKey ¶
func SameIdentity ¶
func SetIdentity ¶
func VerifySignedHash ¶
func VerifySignedHash(s SignedHash, trusts []Identity, hash []byte) bool
Types ¶
type HashStream ¶
type HashStream struct {
// contains filtered or unexported fields
}
func NewHashStream ¶
func (*HashStream) Hash ¶
func (s *HashStream) Hash() []byte
func (*HashStream) Size ¶
func (s *HashStream) Size() int64
type Identity ¶
type Identity struct { Nick string `json:"n"` Email string `json:"m"` SignatureKey Key `json:"s"` EncryptionKey Key `json:"e"` }
func IdentityFromBase64 ¶
func NewIdentity ¶
type PrivateKey ¶
type PrivateKey ed25519.PrivateKey
type SignedData ¶
type SignedData struct { Signature [SignatureSize]byte Signer PublicKey }
type SignedHash ¶
type SignedHash struct { Hash []byte `json:"h"` Evidences []SignedHashEvidence `json:"e"` }
func NewSignedHash ¶
func NewSignedHash(hash []byte, i Identity) (SignedHash, error)
type SignedHashEvidence ¶
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
func EncryptingReader ¶
func EncryptingReader(keyId uint64, keyFunc func(uint64) []byte, r io.Reader) (*StreamReader, error)
EncryptedWriter wraps w with an OFB cipher stream.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
func DecryptingWriter ¶
EncryptedWriter wraps w with an OFB cipher stream.
Click to show internal directories.
Click to hide internal directories.