Versions in this module Expand all Collapse all v0 v0.1.0 Jul 23, 2020 Changes in this version + const DefaultCiphersuite + const MaxNotAfter + const ProtocolVersion + var ErrExpired = errors.New("uid: NOTAFTER has expired") + var ErrFuture = errors.New("uid: NOTAFTER is too far in the future") + var ErrIncrement = errors.New("uid: message counter not incremented by one") + var ErrInvalidKeyInitSig = errors.New("uid: KeyInit signature is invalid") + var ErrInvalidNonceSig = errors.New("uid: nonce signature invalid") + var ErrInvalidSelfSig = errors.New("uid: self-signature invalid") + var ErrInvalidSrvSig = errors.New("uid: server-signature invalid (keyserver keys up-to-date?)") + var ErrInvalidTimes = errors.New("uid: key init NOTBEFORE must be smaller than NOTAFTER") + var ErrInvalidUserSig = errors.New("uid: user-signature invalid") + var ErrKeyEntryNotFound = errors.New("uid: KeyEntry not found") + var ErrMsgMismatch = errors.New("uid: UIDMessageReply from key server doesn't match original UIDMessage") + var ErrRepoURI = errors.New("uid: KeyInit has invalid repoURI") + var ErrSessionAnchor = errors.New("uid: SESSIONANCHORHASH does not match decrypted SESSIONANCHOR") + var ErrWrongSigKeyHash = errors.New("uid: KeyInit SIGKEYHASH does not match") + func KeyEntryEqual(a, b *KeyEntry) bool + func SigKeyHash(sigPubKey string) (string, error) + func VerifyNonce(sigPubKey string, nonce uint64, signature string) error + type Entry struct + HASHCHAINENTRY string + HASHCHAINPOS uint64 + UIDMESSAGEENCRYPTED string + type KeyEntry struct + CIPHERSUITE string + FUNCTION string + HASH string + PUBKEY string + func NewJSONKeyEntry(keyEntry []byte) (*KeyEntry, error) + func (ke *KeyEntry) InitDHKey(rand io.Reader) error + func (ke *KeyEntry) JSON() []byte + func (ke *KeyEntry) PrivateKey() string + func (ke *KeyEntry) PrivateKey32() *[32]byte + func (ke *KeyEntry) PrivateKey64() *[64]byte + func (ke *KeyEntry) PublicKey32() *[32]byte + func (ke *KeyEntry) SetPrivateKey(privkey string) error + func (ke *KeyEntry) Verify() error + type KeyInit struct + Contents contents + SIGNATURE string + func NewJSONKeyInit(keyInit []byte) (*KeyInit, error) + func (ki *KeyInit) Check() error + func (ki *KeyInit) JSON() []byte + func (ki *KeyInit) KeyEntryECDHE25519(sigPubKey string) (*KeyEntry, error) + func (ki *KeyInit) MsgCount() uint64 + func (ki *KeyInit) SessionAnchor(sigPubKey string) (*SessionAnchor, error) + func (ki *KeyInit) SigKeyHash() string + func (ki *KeyInit) Sign(sigKey *cipher.Ed25519Key) string + func (ki *KeyInit) Verify(keyInitRepositoryURIs []string, sigPubKey string) error + func (ki *KeyInit) VerifySrvSig(signature, srvPubKey string) error + type Message struct + ESCROWSIGNATURE string + LINKAUTHORITY string + SELFSIGNATURE string + UIDContent uidContent + USERSIGNATURE string + func Create(userID string, sigescrow bool, mixaddress, nymaddress string, ...) (*Message, error) + func NewJSON(uid string) (*Message, error) + func (msg *Message) Check() error + func (msg *Message) Domain() string + func (msg *Message) Encrypt() (UIDHash, UIDIndex []byte, UIDMessageEncrypted string) + func (msg *Message) Identity() string + func (msg *Message) JSON() []byte + func (msg *Message) KeyInit(msgcount, notafter, notbefore uint64, fallback bool, ...) (ki *KeyInit, pubKeyHash, privateKey string, err error) + func (msg *Message) Localpart() string + func (msg *Message) PrivateEncKey() string + func (msg *Message) PrivateEncKey32() *[32]byte + func (msg *Message) PrivateSigKey() string + func (msg *Message) PrivateSigKey64() *[64]byte + func (msg *Message) PubHash() string + func (msg *Message) PubKey() *KeyEntry + func (msg *Message) PublicEncKey32() *[32]byte + func (msg *Message) PublicKey() (*[32]byte, error) + func (msg *Message) PublicSigKey32() *[32]byte + func (msg *Message) SetPrivateEncKey(privkey string) error + func (msg *Message) SetPrivateSigKey(privkey string) error + func (msg *Message) SigKeyHash() (string, error) + func (msg *Message) SigPubKey() string + func (msg *Message) SignNonce() (nonce uint64, signature string) + func (msg *Message) Update(rand io.Reader) (*Message, error) + func (msg *Message) VerifySelfSig() error + func (msg *Message) VerifyUserSig(preMsg *Message) error + type MessageReply struct + ENTRY Entry + SERVERSIGNATURE string + func CreateReply(UIDMessageEncrypted, HCEntry string, HCPos uint64, sigKey *cipher.Ed25519Key) *MessageReply + func NewJSONReply(uid string) (*MessageReply, error) + func (reply *MessageReply) Decrypt(UIDHash []byte) ([]byte, *Message, error) + func (reply *MessageReply) JSON() []byte + func (reply *MessageReply) VerifySrvSig(msg *Message, srvPubKey string) error + type PFSPreference int + const Mandatory + const Optional + const Strict + func (pfsPreference PFSPreference) String() string + type SessionAnchor struct + MIXADDRESS string + NYMADDRESS string + PFKEYS []KeyEntry + func (sa *SessionAnchor) KeyEntry(function string) (*KeyEntry, error) + func (sa *SessionAnchor) NymAddress() string + func (sa *SessionAnchor) PrivateKey() string + func (sa *SessionAnchor) SetPrivateKey(privkey string) error