libkb

package
v0.0.0-...-5e4fb97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2015 License: BSD-3-Clause Imports: 57 Imported by: 0

Documentation

Overview

Code used in populating JSON objects to generating Keybase-style signatures.

A KeyFamily is a group of sibling keys that have equal power for a user. A family can consist of 1 PGP keys, and arbitrarily many NaCl Sibkeys. There also can be some subkeys dangling off for ECDH.

A module for syncing secrets with the server, such as P3SKB PGP keys, and server-halves of our various secret keys.

Index

Constants

View Source
const (
	XAPI_RES_JSON = iota
	XAPI_RES_HTML = iota
	XAPI_RES_TEXT = iota
)
View Source
const (
	NONE   = iota
	OR     = iota
	AND    = iota
	LPAREN = iota
	RPAREN = iota
	URL    = iota
	EOF    = iota
	ERROR  = iota
)
View Source
const (
	SC_OK                        = 0
	SC_BAD_SESSION               = 202
	SC_BAD_LOGIN_PASSWORD        = 204
	SC_GENERIC                   = 218
	SC_BAD_SIGNUP_USERNAME_TAKEN = 701
	SC_KEY_BAD_GEN               = 913
	SC_BAD_TRACK_SESSION         = 1301
)
View Source
const (
	MERKLE_TREE_NODE = 1
	MERKLE_TREE_LEAF = 2
)
View Source
const (
	PROOF_STATE_NONE         = 0
	PROOF_STATE_OK           = 1
	PROOF_STATE_TEMP_FAILURE = 2
	PROOF_STATE_PERM_FAILURE = 3
	PROOF_STATE_LOOKING      = 4
	PROOF_STATE_SUPERSEDED   = 5
	PROOF_STATE_POSTED       = 6
	PROOF_STATE_REVOKED      = 7
)

Taken from node-client/src/constants.iced

View Source
const (
	SIG_TYPE_NONE           = 0
	SIG_TYPE_SELF_SIG       = 1
	SIG_TYPE_REMOTE_PROOF   = 2
	SIG_TYPE_TRACK          = 3
	SIG_TYPE_UNTRACK        = 4
	SIG_TYPE_REVOKE         = 5
	SIG_TYPE_CRYPTOCURRENCY = 6
	SIG_TYPE_ANNOUNCEMENT   = 7
)
View Source
const (
	DB_USER                       = 0x00
	DB_SIG                        = 0x0f
	DB_LINK                       = 0xe0
	DB_LOCAL_TRACK                = 0xe1
	DB_PGP_KEY                    = 0xe3
	DB_SIG_HINTS                  = 0xe4
	DB_PROOF_CHECK                = 0xe5
	DB_USER_SECRET_KEYS           = 0xe6
	DB_SIG_CHAIN_TAIL_PUBLIC      = 0xe7
	DB_SIG_CHAIN_TAIL_SEMIPRIVATE = 0xe8
	DB_SIG_CHAIN_TAIL_ENCRYPTED   = 0xe9
	DB_MERKLE_ROOT                = 0xf0
)
View Source
const (
	DB_LOOKUP_USERNAME    = 0x00
	DB_LOOKUP_MERKLE_ROOT = 0x01
)
View Source
const (
	DEVICE_ID_LEN    = 32
	DEVICE_ID_SUFFIX = 0x18
)
View Source
const (
	KEYGEN_PHASE_NONE      = iota
	KEYGEN_PHASE_CHECKED   = iota
	KEYGEN_PHASE_GENERATED = iota
	KEYGEN_PHASE_POSTED    = iota
)
View Source
const (
	NODE_HASH_LEN_LONG  = sha512.Size // = 64
	NODE_HASH_LEN_SHORT = sha256.Size // = 32
)
View Source
const (
	PROOF_NONE  = 0
	PROOF_OK    = 1
	PROOF_LOCAL = 2
	PROOF_FOUND = 3 // It's been found in the hunt, but not proven yet

	// Retryable =soft errors
	PROOF_BASE_ERROR        = 100
	PROOF_HOST_UNREACHABLE  = 101
	PROOF_PERMISSION_DENIED = 103 // # Since the user might fix it
	PROOF_FAILED_PARSE      = 106
	PROOF_DNS_ERROR         = 107
	PROOF_AUTH_FAILED       = 108
	PROOF_HTTP_500          = 150
	PROOF_TIMEOUT           = 160
	PROOF_INTERNAL_ERROR    = 170

	// Likely will result in a hard error, if repeated enough
	PROOF_BASE_HARD_ERROR  = 200
	PROOF_NOT_FOUND        = 201
	PROOF_CONTENT_FAILURE  = 202
	PROOF_BAD_USERNAME     = 203
	PROOF_BAD_REMOTE_ID    = 204
	PROOF_TEXT_NOT_FOUND   = 205
	PROOF_BAD_ARGS         = 206
	PROOF_CONTENT_MISSING  = 207
	PROOF_TITLE_NOT_FOUND  = 208
	PROOF_SERVICE_ERROR    = 209
	PROOF_TOR_SKIPPED      = 210
	PROOF_TOR_INCOMPATIBLE = 211
	PROOF_HTTP_300         = 230
	PROOF_HTTP_400         = 240
	PROOF_HTTP_OTHER       = 260
	PROOF_EMPTY_JSON       = 270

	// Hard final errors
	PROOF_DELETED       = 301
	PROOF_SERVICE_DEAD  = 302
	PROOF_BAD_SIGNATURE = 303
	PROOF_BAD_API_URL   = 304
	PROOF_UNKNOWN_TYPE  = 305
	PROOF_NO_HINT       = 306
	PROOF_BAD_HINT_TEXT = 307
)
View Source
const (
	SIG_ID_LEN    = 32
	SIG_ID_SUFFIX = 0x0f
)
View Source
const (
	UID_LEN    = 16
	UID_SUFFIX = 0x00
)
View Source
const (
	HTTP_DEFAULT_TIMEOUT = 10 * time.Second
)
View Source
const (
	ID_SUFFIX_KID = 0x0a
)
View Source
const (
	LINK_ID_LEN = 32
)
View Source
const NACL_DH_KEYSIZE = 32
View Source
const (
	PGP_FINGERPRINT_LEN = 20
)
View Source
const SharedSecretLen = 32

Variables

View Source
var (
	KEYBASE_PACKET_V1 = 1
	TAG_P3SKB         = 513
	TAG_SIGNATURE     = 514
)

Packet tags for OpenPGP and also Keybase packets

View Source
var (
	KID_PGP_BASE    = 0x00
	KID_PGP_RSA     = 0x1
	KID_PGP_ELGAMAL = 0x10
	KID_PGP_DSA     = 0x11
	KID_PGP_ECDH    = 0x12
	KID_PGP_ECDSA   = 0x13
	KID_NACL_EDDSA  = 0x20
	KID_NACL_DH     = 0x21
)
View Source
var (
	HASH_PGP_MD5       = 1
	HASH_PGP_SHA1      = 2
	HASH_PGP_RIPEMD160 = 3
	HASH_PGP_SHA256    = 8
	HASH_PGP_SHA384    = 9
	HASH_PGP_SHA512    = 10
	HASH_PGP_SHA224    = 11
)

OpenPGP hash IDs, taken from http://tools.ietf.org/html/rfc4880#section-9.4

View Source
var (
	PROOF_TYPE_NONE             = 0
	PROOF_TYPE_KEYBASE          = 1
	PROOF_TYPE_TWITTER          = 2
	PROOF_TYPE_GITHUB           = 3
	PROOF_TYPE_REDDIT           = 4
	PROOF_TYPE_COINBASE         = 5
	PROOF_TYPE_HACKERNEWS       = 6
	PROOF_TYPE_GENERIC_WEB_SITE = 1000
	PROOF_TYPE_DNS              = 1001
)
View Source
var (
	REV_SIMPLE_DELETE = 0
	REV_FULL          = 1
	REV_DATED         = 2
)

key_revocation_types

View Source
var (
	KEY_LIVE       = 0
	KEY_REVOKED    = 1
	KEY_DELETED    = 2
	KEY_SUPERSEDED = 3
)

key_status

View Source
var API_URI_PATH_PREFIX = "/_/api/" + API_VERSION
View Source
var API_VERSION = "1.0"
View Source
var BundledCAs = map[string]string{

	"api.keybase.io": `-----BEGIN CERTIFICATE-----
MIIGmzCCBIOgAwIBAgIJAPzhpcIBaOeNMA0GCSqGSIb3DQEBBQUAMIGPMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCTlkxETAPBgNVBAcTCE5ldyBZb3JrMRQwEgYDVQQK
EwtLZXliYXNlIExMQzEXMBUGA1UECxMOQ2VydCBBdXRob3JpdHkxEzARBgNVBAMT
CmtleWJhc2UuaW8xHDAaBgkqhkiG9w0BCQEWDWNhQGtleWJhc2UuaW8wHhcNMTQw
MTAyMTY0MjMzWhcNMjMxMjMxMTY0MjMzWjCBjzELMAkGA1UEBhMCVVMxCzAJBgNV
BAgTAk5ZMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UEChMLS2V5YmFzZSBMTEMx
FzAVBgNVBAsTDkNlcnQgQXV0aG9yaXR5MRMwEQYDVQQDEwprZXliYXNlLmlvMRww
GgYJKoZIhvcNAQkBFg1jYUBrZXliYXNlLmlvMIICIjANBgkqhkiG9w0BAQEFAAOC
Ag8AMIICCgKCAgEA3sLA6ZG8uOvmlFvFLVIOURmcQrZyMFKbVu9/TeDiemls3w3/
JzVTduD+7KiUi9R7QcCW/V1ZpReTfunm7rfACiJ1fpIkjSQrgsvKDLghIzxIS5FM
I8utet5p6QtuJhaAwmmXn8xX05FvqWNbrcXRdpL4goFdigPsFK2xhTUiWatLMste
oShI7+zmrgkx75LeLMD0bL2uOf87JjOzbY8x2sUIZLGwPoATyG8WS38ey6KkJxRj
AhG3p+OTYEjYSrsAtQA6ImbeDpfSHKOB8HF3nVp//Eb4HEiEsWwBRbQXvAWh3DYL
GukFW0wiO0HVCoWY+bHL/Mqa0NdRGOlLsbL4Z4pLrhqKgSDU8umX9YuNRRaB0P5n
TkzyU6axHqzq990Gep/I62bjsBdYYp+DjSPK43mXRrfWJl2NTcl8xKAyfsOW+9hQ
9vwK0tpSicNxfYuUZs0BhfjSZ/Tc6Z1ERdgUYRiXTtohl+SRA2IgZMloHCllVMNj
EjXhguvHgLAOrcuyhVBupiUQGUHQvkMsr1Uz8VPNDFOJedwucRU2AaR881bknnSb
ds9+zNLsvUFV+BK7Qdnt/WkFpYL78rGwY47msi9Ooddx6fPyeg3qkJGM6cwn/boy
w9lQeleYDq8kyJdixIAxtAskNzRPJ4nDu2izTfByQoM8epwAWboc/gNFObMCAwEA
AaOB9zCB9DAdBgNVHQ4EFgQURqpATOw1gVVrzlqqFKbkfaKXvwowgcQGA1UdIwSB
vDCBuYAURqpATOw1gVVrzlqqFKbkfaKXvwqhgZWkgZIwgY8xCzAJBgNVBAYTAlVT
MQswCQYDVQQIEwJOWTERMA8GA1UEBxMITmV3IFlvcmsxFDASBgNVBAoTC0tleWJh
c2UgTExDMRcwFQYDVQQLEw5DZXJ0IEF1dGhvcml0eTETMBEGA1UEAxMKa2V5YmFz
ZS5pbzEcMBoGCSqGSIb3DQEJARYNY2FAa2V5YmFzZS5pb4IJAPzhpcIBaOeNMAwG
A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggIBAA3Z5FIhulYghMuHdcHYTYWc
7xT5WD4hXQ0WALZs4p5Y+b2Af54o6v1wUE1Au97FORq5CsFXX/kGl/JzzTimeucn
YJwGuXMpilrlHCBAL5/lSQjA7qbYIolQ3SB9ON+LYuF1jKB9k8SqNp7qzucxT3tO
b8ZMDEPNsseC7NE2uwNtcW3yrTh6WZnSqg/jwswiWjHYDdG7U8FjMYlRol3wPux2
PizGbSgiR+ztI2OthxtxNWMrT9XKxNQTpcxOXnLuhiSwqH8PoY17ecP8VPpaa0K6
zym0zSkbroqydazaxcXRk3eSlc02Ktk7HzRzuqQQXhRMkxVnHbFHgGsz03L533pm
mlIEgBMggZkHwNvs1LR7f3v2McdKulDH7Mv8yyfguuQ5Jxxt7RJhUuqSudbEhoaM
6jAJwBkMFxsV2YnyFEd3eZ/qBYPf7TYHhyzmHW6WkSypGqSnXd4gYpJ8o7LxSf4F
inLjxRD+H9Xn1UVXWLM0gaBB7zZcXd2zjMpRsWgezf5IR5vyakJsc7fxzgor3Qeq
Ri6LvdEkhhFVl5rHMQBwNOPngySrq8cs/ikTLTfQVTYXXA4Ba1YyiMOlfaR1LhKw
If1AkUV0tfCTNRZ01EotKSK77+o+k214n+BAu+7mO+9B5Kb7lMFQcuWCHXKYB2Md
cT7Yh09F0QpFUd0ymEfv
-----END CERTIFICATE-----`,
}
View Source
var CANONICAL_HOST = "keybase.io"
View Source
var CLIENT_VERSION = "1.0.0"
View Source
var CONFIG_FILE = "config.json"
View Source
var CheckEmail = Checker{
	F: func(s string) bool {
		re := regexp.MustCompile(`^\S+@\S+\.\S+$`)
		return len(s) > 3 && re.MatchString(s)
	},
	Hint: "must be a valid email address",
}
View Source
var CheckEmailOrUsername = Checker{
	F: func(s string) bool {
		return CheckEmail.F(s) || CheckUsername.F(s)
	},
	Hint: "valid usernames are 2-12 letters long",
}
View Source
var CheckInviteCode = Checker{
	F: func(s string) bool {
		if b, err := hex.DecodeString(s); err != nil {
			return false
		} else {
			return len(b) == 12
		}
	},
	Hint: "Invite codes are 24-digit hex strings",
}
View Source
var CheckPassphraseNew = Checker{

	F: func(s string) bool {
		r := []rune(s)
		if len(r) > 0 && unicode.IsSpace(r[0]) {
			return false
		} else {
			return len(s) >= 12
		}
	},
	Hint:          "passphrase must be 12 or more characters",
	PreserveSpace: true,
}
View Source
var CheckPassphraseSimple = Checker{
	F: func(s string) bool {
		return len(s) > 0
	},
	Hint: "passphrase cannot be empty",
}
View Source
var CheckUsername = Checker{
	F: func(s string) bool {
		re := regexp.MustCompile(`^([a-z0-9][a-z0-9_]?)+$`)
		return len(s) >= 2 && len(s) <= 16 && re.MatchString(s)
	},
	Hint: "between 2 and 16 characters long",
}
View Source
var CheckYesNo = Checker{
	F: func(s string) bool {
		return IsYes(s) || IsNo(s)
	},
	Hint: "'yes' or 'no'",
}
View Source
var DAEMON_PORT = 40933
View Source
var DB_FILE = "keybase.leveldb"
View Source
var ErrKeyGenArgNoDefNoCustom = stderrors.New("invalid args:  NoDefPGPUid set, but no custom PGPUids.")
View Source
var GO_CLIENT_ID = "keybase.io go client"
View Source
var IDENTIFY_AS = GO_CLIENT_ID + " v" + CLIENT_VERSION + " " + runtime.GOOS
View Source
var KEYBASE_KID_V1 = 1 // Uses SHA-256
View Source
var KEYBASE_KID_V2 = 2 // Uses Shake256
View Source
var KEYBASE_SIGNATURE_V1 = 1
View Source
var MERKLE_PROD_KEY = "03E146CDAF8136680AD566912A32340CEC8C9492"
View Source
var MERKLE_TEST_KEY = "A05161510EE696601BA0EC7B3FD53B4871528CEF"
View Source
var NACL_DH_EXPIRE_IN = 24 * 60 * 60 * 365 * 3 // 3 years
View Source
var NACL_EDDSA_EXPIRE_IN = 24 * 60 * 60 * 365 * 3 // 3 years
View Source
var PERM_DIR os.FileMode = 0700
View Source
var PERM_FILE os.FileMode = 0600
View Source
var PGP_FINGERPRINT_HEX_LEN = 40
View Source
var PGP_VERSION = "Keybase Go CLI " + CLIENT_VERSION + " (" + runtime.GOOS + ")"
View Source
var PROOF_CACHE_SIZE = 0x10000
View Source
var REDDIT_PREFIX = "https://www.reddit.com"
View Source
var REDDIT_SUB = REDDIT_PREFIX + "/r/keybaseproofs"
View Source
var REMOTE_SERVICE_TYPES = map[string]int{
	"keybase":    PROOF_TYPE_KEYBASE,
	"twitter":    PROOF_TYPE_TWITTER,
	"github":     PROOF_TYPE_GITHUB,
	"reddit":     PROOF_TYPE_REDDIT,
	"coinbase":   PROOF_TYPE_COINBASE,
	"hackernews": PROOF_TYPE_HACKERNEWS,
	"https":      PROOF_TYPE_GENERIC_WEB_SITE,
	"http":       PROOF_TYPE_GENERIC_WEB_SITE,
	"dns":        PROOF_TYPE_DNS,
}
View Source
var SECRET_KEYRING = "secretkeys.mpack"
View Source
var (
	SERVER_UPDATE_LAG = time.Minute
)
View Source
var SERVER_URL = "https://api.keybase.io:443"
View Source
var SESSION_FILE = "session.json"
View Source
var SHA256_CODE int = 8
View Source
var SIG_EXPIRE_IN = 24 * 60 * 60 * 365 * 10 // 10 years
View Source
var (
	SIG_KB_EDDSA = KID_NACL_EDDSA
)
View Source
var SIG_SHORT_ID_BYTES = 27
View Source
var SOCKET_FILE = "keybased.sock"
View Source
var TRACK_SESSION_TIMEOUT = time.Minute
View Source
var UMASKABLE_PERM_FILE os.FileMode = 0666
View Source
var USER_AGENT = ("Keybase-Go-CLI/" + CLIENT_VERSION +
	" (" + runtime.Version() + " on " + runtime.GOOS + ")")
View Source
var USER_CACHE_SIZE = 0x1000

Functions

func ApiBase

func ApiBase(un string) string

func AttachedSign

func AttachedSign(out io.WriteCloser, signed openpgp.Entity, hints *openpgp.FileHints,
	config *packet.Config) (in io.WriteCloser, err error)

AttachedSign is like openpgp.Encrypt (as in p.crypto/openpgp/write.go), but don't encrypt at all, just sign the literal unencrypted data. Unfortunately we need to duplicate some code here that's already in write.go

func AttachedSignWrapper

func AttachedSignWrapper(out io.WriteCloser, key PgpKeyBundle, armored bool) (
	in io.WriteCloser, err error)

func BindToSocket

func BindToSocket(info SocketInfo) (ret net.Listener, err error)

func BtcAddrCheck

func BtcAddrCheck(s string, opts *BtcOpts) (version int, pkhash []byte, err error)

func CheckKarma

func CheckKarma(un string) (int, error)

func CheckPosted

func CheckPosted(proofId string) (found bool, status int, err error)

func CheckUsernameAvailable

func CheckUsernameAvailable(s string) (err error)

func Cicmp

func Cicmp(s1, s2 string) bool

func ClientId

func ClientId() *jsonw.Wrapper

func CodecHandle

func CodecHandle() *codec.MsgpackHandle

func Decode58

func Decode58(inp string) (outp []byte, err error)

func DeletePrimary

func DeletePrimary() (err error)

func DialSocket

func DialSocket(info SocketInfo) (ret net.Conn, err error)

func DisplayTrackArg

func DisplayTrackArg(sessionID int, stmt string) *keybase_1.DisplayTrackStatementArg

func DrainPipe

func DrainPipe(rc io.Reader, sink func(string)) error

func Encode58

func Encode58(inp []byte) string

func ErrToOk

func ErrToOk(err error) string

func ExportAsFOKID

func ExportAsFOKID(fp *PgpFingerprint, kid KID) (ret keybase_1.FOKID)

func ExportErrorAsStatus

func ExportErrorAsStatus(e error) (ret *keybase_1.Status)

func ExportProofError

func ExportProofError(pe ProofError) (ret keybase_1.ProofStatus)

func ExportRemoteProof

func ExportRemoteProof(p RemoteProofChainLink) keybase_1.RemoteProof

func ExportTrackDiff

func ExportTrackDiff(d TrackDiff) (res *keybase_1.TrackDiff)

func ExportTrackSummary

func ExportTrackSummary(l *TrackLookup) *keybase_1.TrackSummary

func FastByteArrayEq

func FastByteArrayEq(a, b []byte) bool

func FileExists

func FileExists(path string) (bool, error)

exists returns whether the given file or directory exists or not

func FindBase64Block

func FindBase64Block(s string, pattern []byte, url bool) bool

func FindBase64Blocks

func FindBase64Blocks(s string) []string

func FindBase64Snippets

func FindBase64Snippets(s string) []string

func FindFirstBase64Block

func FindFirstBase64Block(s string) string

func FindPinentry

func FindPinentry() (string, error)

func FormatTime

func FormatTime(tm time.Time) string

func GetLinkIdVoid

func GetLinkIdVoid(w *jsonw.Wrapper, l *LinkId, e *error)

func GetNodeHashVoid

func GetNodeHashVoid(w *jsonw.Wrapper, nhp *NodeHash, errp *error)

func GetPgpFingerprintVoid

func GetPgpFingerprintVoid(w *jsonw.Wrapper, p *PgpFingerprint, e *error)

func GetSigIdVoid

func GetSigIdVoid(jw *jsonw.Wrapper, suffix bool, p *SigId, e *error)

func GetUidVoid

func GetUidVoid(w *jsonw.Wrapper, u *UID, e *error)

func GiveMeAnS

func GiveMeAnS(i int) string

func ImportStatusAsError

func ImportStatusAsError(s *keybase_1.Status) error

func IsEmpty

func IsEmpty(s string) bool

func IsIn

func IsIn(needle string, haystack []string, ci bool) bool

func IsNo

func IsNo(s string) bool

func IsPgpAlgo

func IsPgpAlgo(algo int) bool

func IsValidHostname

func IsValidHostname(s string) bool

func IsYes

func IsYes(s string) bool

func KarmaUrl

func KarmaUrl(un string) string

func KeyToProofJson

func KeyToProofJson(key GenericKey) *jsonw.Wrapper

func KeybaseEmailAddress

func KeybaseEmailAddress(s string) string

func LockPIDFile

func LockPIDFile(filename string) error

LockPIDFile writes the pid to filename after acquiring a lock on the file. When the process exits, the lock will be released.

func LoginAndIdentify

func LoginAndIdentify(arg LoginAndIdentifyArg) error

func MakeParentDirs

func MakeParentDirs(filename string) error

func NewApiEngines

func NewApiEngines(e Env) (*InternalApiEngine, *ExternalApiEngine, error)

Make a new InternalApiEngine and a new ExternalApiEngine, which share the same network config (i.e., TOR and Proxy parameters)

func NewDnsChecker

func NewDnsChecker(p RemoteProofChainLink) (*DnsChecker, ProofError)
func NewTypedChainLink(cl *ChainLink) (ret TypedChainLink, w Warning)

func NewWebChecker

func NewWebChecker(p RemoteProofChainLink) (*WebChecker, ProofError)

func PacketArmoredEncode

func PacketArmoredEncode(p Packetable) (ret string, err error)

func ParseCA

func ParseCA(raw string) (*x509.CertPool, error)

func ParseDns

func ParseDns(s string) (ret string, err error)

func ParseGpgIndexStream

func ParseGpgIndexStream(stream io.Reader) (ki *GpgKeyIndex, err error, w Warnings)

func ParseWeb

func ParseWeb(s string) (hostname string, prot string, err error)

func PgpArmorHeaders

func PgpArmorHeaders() map[string]string

func PickFirstError

func PickFirstError(errors ...error) error

func PostInviteRequest

func PostInviteRequest(arg InviteRequestArg) (err error)

func PostNewKey

func PostNewKey(arg PostNewKeyArg) error

func PromptForNewTsec

func PromptForNewTsec(arg keybase_1.GetNewPassphraseArg, ui SecretUI) (tsec *triplesec.Cipher, err error)

func ProofErrorIsSoft

func ProofErrorIsSoft(pe ProofError) bool

func ProofErrorToState

func ProofErrorToState(pe ProofError) int

func RegisterProofCheckHook

func RegisterProofCheckHook(s string, h ProofCheckHook)

func RegisterServiceType

func RegisterServiceType(st ServiceType)

func RegisterSocialNetwork

func RegisterSocialNetwork(s string)

func SafeWriteToFile

func SafeWriteToFile(t SafeWriter) error

func SecureByteArrayEq

func SecureByteArrayEq(a, b []byte) bool

func ShortCA

func ShortCA(raw string) string

func ShowKeys

func ShowKeys(ui LogUI) (err error)

ShowKeys shows the status of your current KeyFamily. For now, something very simple, just dump the info to the Log. Eventually we'll want many more features here.

func SignJson

func SignJson(jw *jsonw.Wrapper, key GenericKey) (out string, id *SigId, lid LinkId, err error)

SimpleSignJson marshals the given Json structure and then signs it.

func SplitHost

func SplitHost(joined string) (host string, port int, err error)

func StoreLocalTrack

func StoreLocalTrack(id UID, statement *jsonw.Wrapper) error

func Tablify

func Tablify(writer io.Writer, headings []string, rowfunc func() []string)

func TempFile

func TempFile(prefix string, mode os.FileMode) (string, *os.File, error)

func TrackStatementJSON

func TrackStatementJSON(me, them *User) (string, error)

func Uniquify

func Uniquify(inp []string) []string

func UnwrapError

func UnwrapError(nxt rpc2.DecodeNext) (app error, dispatch error)

func VersionMessage

func VersionMessage(linefn func(string))

func WrapError

func WrapError(e error) interface{}

Types

type API

type API interface {
	Get(ApiArg) (*ApiRes, error)
	Post(ApiArg) (*ApiRes, error)
}

type AlreadyRegisteredError

type AlreadyRegisteredError struct {
	// contains filtered or unexported fields
}

func (AlreadyRegisteredError) Error

func (u AlreadyRegisteredError) Error() string

type ApiArg

type ApiArg struct {
	Endpoint string

	Args        HttpArgs
	NeedSession bool
	HttpStatus  []int
	AppStatus   []string
	DecodeTo    interface{}
	// contains filtered or unexported fields
}

type ApiError

type ApiError struct {
	Msg  string
	Code int
}

func NewApiErrorFromError

func NewApiErrorFromError(err error) ApiError

func NewApiErrorFromHttpResponse

func NewApiErrorFromHttpResponse(r *http.Response) *ApiError

func (*ApiError) Error

func (a *ApiError) Error() string

type ApiRes

type ApiRes struct {
	Status     *jsonw.Wrapper
	Body       *jsonw.Wrapper
	HttpStatus int
	AppStatus  string
}

type ApiStatus

type ApiStatus struct {
	Code int    `json:"code"`
	Name string `json:"name"`
}

type AppStatusError

type AppStatusError struct {
	Code   int
	Name   string
	Desc   string
	Fields map[string]bool
}

func NewAppStatusError

func NewAppStatusError(jw *jsonw.Wrapper) AppStatusError

func (AppStatusError) Error

func (a AppStatusError) Error() string

func (AppStatusError) IsBadField

func (a AppStatusError) IsBadField(s string) bool

func (AppStatusError) ToStatus

func (a AppStatusError) ToStatus() keybase_1.Status

type AssertionAnd

type AssertionAnd struct {
	// contains filtered or unexported fields
}

func NewAssertionAnd

func NewAssertionAnd(left, right AssertionExpression) AssertionAnd

func (AssertionAnd) CollectUrls

func (a AssertionAnd) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionAnd) HasOr

func (a AssertionAnd) HasOr() bool

func (AssertionAnd) MatchSet

func (a AssertionAnd) MatchSet(ps ProofSet) bool

func (AssertionAnd) String

func (a AssertionAnd) String() string

type AssertionDns

type AssertionDns struct{ AssertionUrlBase }

func (AssertionDns) Check

func (a AssertionDns) Check() (err error)

func (AssertionDns) CollectUrls

func (a AssertionDns) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionDns) MatchSet

func (a AssertionDns) MatchSet(ps ProofSet) bool

func (AssertionDns) ToLookup

func (k AssertionDns) ToLookup() (key, value string, err error)

type AssertionExpression

type AssertionExpression interface {
	String() string
	MatchSet(ps ProofSet) bool
	HasOr() bool
	CollectUrls([]AssertionUrl) []AssertionUrl
}

func AssertionParse

func AssertionParse(s string) (AssertionExpression, error)

func AssertionParseAndOnly

func AssertionParseAndOnly(s string) (AssertionExpression, error)

type AssertionFingerprint

type AssertionFingerprint struct{ AssertionUrlBase }

func (AssertionFingerprint) CollectUrls

func (a AssertionFingerprint) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionFingerprint) IsFingerprint

func (k AssertionFingerprint) IsFingerprint() bool

func (AssertionFingerprint) MatchProof

func (a AssertionFingerprint) MatchProof(proof Proof) bool

Fingerprint matching is on the suffixes. If the assertion matches any suffix of the proof, then we're OK

func (AssertionFingerprint) MatchSet

func (a AssertionFingerprint) MatchSet(ps ProofSet) bool

func (AssertionFingerprint) ToLookup

func (k AssertionFingerprint) ToLookup() (key, value string, err error)

type AssertionHttp

type AssertionHttp struct{ AssertionUrlBase }

func (AssertionHttp) Check

func (a AssertionHttp) Check() (err error)

func (AssertionHttp) CollectUrls

func (a AssertionHttp) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionHttp) Keys

func (a AssertionHttp) Keys() []string

func (AssertionHttp) MatchSet

func (a AssertionHttp) MatchSet(ps ProofSet) bool

func (AssertionHttp) ToLookup

func (k AssertionHttp) ToLookup() (key, value string, err error)

type AssertionHttps

type AssertionHttps struct{ AssertionUrlBase }

func (AssertionHttps) Check

func (a AssertionHttps) Check() (err error)

func (AssertionHttps) CollectUrls

func (a AssertionHttps) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionHttps) MatchSet

func (a AssertionHttps) MatchSet(ps ProofSet) bool

func (AssertionHttps) ToLookup

func (k AssertionHttps) ToLookup() (key, value string, err error)

type AssertionKeybase

type AssertionKeybase struct{ AssertionUrlBase }

func (AssertionKeybase) CollectUrls

func (a AssertionKeybase) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionKeybase) IsKeybase

func (k AssertionKeybase) IsKeybase() bool

func (AssertionKeybase) MatchSet

func (a AssertionKeybase) MatchSet(ps ProofSet) bool

func (AssertionKeybase) ToLookup

func (k AssertionKeybase) ToLookup() (key, value string, err error)

type AssertionOr

type AssertionOr struct {
	// contains filtered or unexported fields
}

func NewAssertionOr

func NewAssertionOr(left, right AssertionExpression) AssertionOr

func (AssertionOr) CollectUrls

func (a AssertionOr) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionOr) HasOr

func (a AssertionOr) HasOr() bool

func (AssertionOr) MatchSet

func (a AssertionOr) MatchSet(ps ProofSet) bool

func (AssertionOr) String

func (a AssertionOr) String() string

type AssertionParseError

type AssertionParseError struct {
	// contains filtered or unexported fields
}

func NewAssertionParseError

func NewAssertionParseError(s string, a ...interface{}) AssertionParseError

func NewNeedInputError

func NewNeedInputError(s string, a ...interface{}) AssertionParseError

func (AssertionParseError) Error

func (e AssertionParseError) Error() string

type AssertionSocial

type AssertionSocial struct{ AssertionUrlBase }

func (AssertionSocial) Check

func (s AssertionSocial) Check() (err error)

func (AssertionSocial) CollectUrls

func (a AssertionSocial) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionSocial) IsSocial

func (k AssertionSocial) IsSocial() bool

func (AssertionSocial) MatchSet

func (a AssertionSocial) MatchSet(ps ProofSet) bool

func (AssertionSocial) ToLookup

func (k AssertionSocial) ToLookup() (key, value string, err error)

type AssertionUid

type AssertionUid struct {
	AssertionUrlBase
	// contains filtered or unexported fields
}

func (AssertionUid) Check

func (u AssertionUid) Check() (err error)

func (AssertionUid) CollectUrls

func (a AssertionUid) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionUid) IsUid

func (k AssertionUid) IsUid() bool

func (AssertionUid) MatchSet

func (a AssertionUid) MatchSet(ps ProofSet) bool

func (AssertionUid) ToLookup

func (k AssertionUid) ToLookup() (key, value string, err error)

func (AssertionUid) ToUid

func (u AssertionUid) ToUid() *UID

type AssertionUrl

type AssertionUrl interface {
	AssertionExpression
	Keys() []string
	Check() error
	IsKeybase() bool
	IsUid() bool
	ToUid() *UID
	IsSocial() bool
	IsFingerprint() bool
	MatchProof(p Proof) bool
	ToKeyValuePair() (string, string)
	CacheKey() string
	GetValue() string
	ToLookup() (string, string, error)
}

func ParseAssertionUrl

func ParseAssertionUrl(s string, strict bool) (ret AssertionUrl, err error)

func ParseAssertionUrlKeyValue

func ParseAssertionUrlKeyValue(key, val string,
	strict bool) (ret AssertionUrl, err error)

type AssertionUrlBase

type AssertionUrlBase struct {
	Key, Value string
}

func (AssertionUrlBase) CacheKey

func (b AssertionUrlBase) CacheKey() string

func (AssertionUrlBase) Check

func (a AssertionUrlBase) Check() (err error)

func (AssertionUrlBase) CheckHost

func (a AssertionUrlBase) CheckHost() (err error)

func (AssertionUrlBase) GetValue

func (b AssertionUrlBase) GetValue() string

func (AssertionUrlBase) HasOr

func (a AssertionUrlBase) HasOr() bool

func (AssertionUrlBase) IsFingerprint

func (a AssertionUrlBase) IsFingerprint() bool

func (AssertionUrlBase) IsKeybase

func (a AssertionUrlBase) IsKeybase() bool

func (AssertionUrlBase) IsSocial

func (a AssertionUrlBase) IsSocial() bool

func (AssertionUrlBase) IsUid

func (a AssertionUrlBase) IsUid() bool

func (AssertionUrlBase) Keys

func (a AssertionUrlBase) Keys() []string

func (AssertionUrlBase) MatchProof

func (a AssertionUrlBase) MatchProof(proof Proof) bool

func (AssertionUrlBase) String

func (a AssertionUrlBase) String() string

func (AssertionUrlBase) ToKeyValuePair

func (b AssertionUrlBase) ToKeyValuePair() (string, string)

func (AssertionUrlBase) ToUid

func (a AssertionUrlBase) ToUid() *UID

type AssertionWeb

type AssertionWeb struct{ AssertionUrlBase }

func (AssertionWeb) Check

func (a AssertionWeb) Check() (err error)

func (AssertionWeb) CollectUrls

func (a AssertionWeb) CollectUrls(v []AssertionUrl) []AssertionUrl

func (AssertionWeb) Keys

func (a AssertionWeb) Keys() []string

func (AssertionWeb) MatchSet

func (a AssertionWeb) MatchSet(ps ProofSet) bool

func (AssertionWeb) ToLookup

func (k AssertionWeb) ToLookup() (key, value string, err error)

type B

type B struct {
	Val bool
}

func (B) String

func (b B) String() string

type BadFingerprintError

type BadFingerprintError struct {
	// contains filtered or unexported fields
}

func (BadFingerprintError) Error

func (b BadFingerprintError) Error() string

type BadKeyError

type BadKeyError struct {
	// contains filtered or unexported fields
}

func (BadKeyError) Error

func (p BadKeyError) Error() string

type BadRevocationError

type BadRevocationError struct {
	// contains filtered or unexported fields
}

func (BadRevocationError) Error

func (e BadRevocationError) Error() string

type BadServiceError

type BadServiceError struct {
	// contains filtered or unexported fields
}

func (BadServiceError) Error

func (e BadServiceError) Error() string

type BadSigError

type BadSigError struct {
	// contains filtered or unexported fields
}

func (BadSigError) Error

func (e BadSigError) Error() string

type BadUsernameError

type BadUsernameError struct {
	// contains filtered or unexported fields
}

func (BadUsernameError) Error

func (e BadUsernameError) Error() string

type Base

type Base struct {
	// contains filtered or unexported fields
}

func (Base) Join

func (b Base) Join(elem ...string) string

func (Base) Unsplit

func (b Base) Unsplit(v []string) string

type Base64Finder

type Base64Finder struct {
	// contains filtered or unexported fields
}

func NewBase64Finder

func NewBase64Finder(i string) *Base64Finder

func (*Base64Finder) Run

func (s *Base64Finder) Run() []string

type BaseApiEngine

type BaseApiEngine struct {
	// contains filtered or unexported fields
}

Shared code across Internal and External APIs

func (*BaseApiEngine) PrepareGet

func (base *BaseApiEngine) PrepareGet(url url.URL, arg ApiArg) (*http.Request, error)

func (*BaseApiEngine) PreparePost

func (base *BaseApiEngine) PreparePost(url url.URL, arg ApiArg) (*http.Request, error)

type BaseServiceType

type BaseServiceType struct{}

func (BaseServiceType) BaseAllStringKeys

func (t BaseServiceType) BaseAllStringKeys(st ServiceType) []string

func (BaseServiceType) BaseCheckProofForUrl

func (t BaseServiceType) BaseCheckProofForUrl(text string, id SigId) (err error)

func (BaseServiceType) BaseCheckProofTextFull

func (t BaseServiceType) BaseCheckProofTextFull(text string, id SigId, sig string) (err error)

func (BaseServiceType) BaseCheckProofTextShort

func (t BaseServiceType) BaseCheckProofTextShort(text string, id SigId, med bool) (err error)

func (BaseServiceType) BaseGetProofType

func (t BaseServiceType) BaseGetProofType(st ServiceType) string

func (BaseServiceType) BasePrimaryStringKeys

func (t BaseServiceType) BasePrimaryStringKeys(st ServiceType) []string

func (BaseServiceType) BaseRecheckProofPosting

func (t BaseServiceType) BaseRecheckProofPosting(tryNumber, status int) (warning *Markup, err error)

func (BaseServiceType) BaseToChecker

func (t BaseServiceType) BaseToChecker(st ServiceType, hint string) Checker

func (BaseServiceType) BaseToServiceJson

func (t BaseServiceType) BaseToServiceJson(st ServiceType, un string) *jsonw.Wrapper

func (BaseServiceType) FormatProofText

func (t BaseServiceType) FormatProofText(ppr *PostProofRes) (string, error)

func (BaseServiceType) GetApiArgKey

func (t BaseServiceType) GetApiArgKey() string

func (BaseServiceType) LastWriterWins

func (t BaseServiceType) LastWriterWins() bool

func (BaseServiceType) NormalizeUsername

func (t BaseServiceType) NormalizeUsername(s string) (string, error)

func (BaseServiceType) PreProofCheck

func (t BaseServiceType) PreProofCheck(string) (*Markup, error)

func (BaseServiceType) PreProofWarning

func (t BaseServiceType) PreProofWarning(remotename string) *Markup

type BtcOpts

type BtcOpts struct {
	// contains filtered or unexported fields
}

type BucketDict

type BucketDict struct {
	// contains filtered or unexported fields
}

func NewBuckDict

func NewBuckDict() *BucketDict

func (*BucketDict) Add

func (bd *BucketDict) Add(k string, v *GpgPrimaryKey)

func (BucketDict) Get

func (bd BucketDict) Get(k string) []*GpgPrimaryKey

func (BucketDict) Get0Or1

func (bd BucketDict) Get0Or1(k string) (ret *GpgPrimaryKey, err error)

type ByMtime

type ByMtime []keybase_1.IdentifyRow

func (ByMtime) Len

func (x ByMtime) Len() int

func (ByMtime) Less

func (x ByMtime) Less(a, b int) bool

func (ByMtime) Swap

func (x ByMtime) Swap(a, b int)
type ChainLink struct {
	// contains filtered or unexported fields
}

func ImportLinkFromServer

func ImportLinkFromServer(parent *SigChain, jw *jsonw.Wrapper) (ret *ChainLink, err error)

func ImportLinkFromStorage

func ImportLinkFromStorage(id LinkId) (*ChainLink, error)
func NewChainLink(parent *SigChain, id LinkId, jw *jsonw.Wrapper) *ChainLink

func (*ChainLink) CheckNameAndId

func (c *ChainLink) CheckNameAndId(s string, i UID) error

func (*ChainLink) GetFOKID

func (c *ChainLink) GetFOKID() FOKID

func (*ChainLink) GetKid

func (c *ChainLink) GetKid() KID

func (ChainLink) GetMerkleSeqno

func (c ChainLink) GetMerkleSeqno() int

func (*ChainLink) GetPayloadJson

func (c *ChainLink) GetPayloadJson() *jsonw.Wrapper

func (*ChainLink) GetPgpFingerprint

func (c *ChainLink) GetPgpFingerprint() *PgpFingerprint

func (ChainLink) GetPrev

func (c ChainLink) GetPrev() LinkId

func (*ChainLink) GetProofState0

func (c *ChainLink) GetProofState0() int

func (ChainLink) GetRevocations

func (c ChainLink) GetRevocations() []*SigId

func (ChainLink) GetRevokeKids

func (c ChainLink) GetRevokeKids() []KID

func (ChainLink) GetSeqno

func (c ChainLink) GetSeqno() Seqno

func (*ChainLink) GetSigCheckCache

func (c *ChainLink) GetSigCheckCache() (cki *ComputedKeyInfos)

func (ChainLink) GetSigId

func (c ChainLink) GetSigId() *SigId

func (*ChainLink) IsInCurrentFamily

func (c *ChainLink) IsInCurrentFamily(u *User) bool

========================================================================= IsInCurrentFamily checks to see if the given chainlink was signed by a key in the current family.

func (*ChainLink) MarkChecked

func (c *ChainLink) MarkChecked(err ProofError)

func (*ChainLink) MatchEldestFOKID

func (c *ChainLink) MatchEldestFOKID(fokid FOKID) bool

MatchFOKID checks if the given ChainLink matches the given FOKID using standard FOKID equality.

func (ChainLink) MatchFingerprint

func (c ChainLink) MatchFingerprint(fp PgpFingerprint) bool

func (ChainLink) MatchUidAndUsername

func (c ChainLink) MatchUidAndUsername(uid UID, username string) bool

func (*ChainLink) Pack

func (c *ChainLink) Pack() error

func (*ChainLink) PutSigCheckCache

func (c *ChainLink) PutSigCheckCache(cki *ComputedKeyInfos)

func (*ChainLink) Store

func (l *ChainLink) Store() (didStore bool, err error)

func (*ChainLink) ToEldestFOKID

func (c *ChainLink) ToEldestFOKID() (ret FOKID)

ToEldestFOKID takes the current chain link and extracts the eldest FOKID from it. Legacy links don't specify it, so we'll have to infer

func (*ChainLink) ToFOKID

func (c *ChainLink) ToFOKID() (ret FOKID)

ToFOKID takes the current chain link and extracts the current (signing) FOKID

func (ChainLink) ToLinkSummary

func (l ChainLink) ToLinkSummary() *LinkSummary

func (ChainLink) ToMerkleTriple

func (l ChainLink) ToMerkleTriple() (ret MerkleTriple)

func (*ChainLink) Unpack

func (c *ChainLink) Unpack(trusted bool) (err error)

func (*ChainLink) UnpackComputedKeyInfos

func (c *ChainLink) UnpackComputedKeyInfos(jw *jsonw.Wrapper) (err error)

func (*ChainLink) UnpackLocal

func (c *ChainLink) UnpackLocal() (err error)

func (*ChainLink) UnpackPayloadJson

func (c *ChainLink) UnpackPayloadJson(tmp *ChainLinkUnpacked) (err error)

func (*ChainLink) VerifyHash

func (c *ChainLink) VerifyHash() error
func (l *ChainLink) VerifyLink() error

func (*ChainLink) VerifyPayload

func (c *ChainLink) VerifyPayload() error

func (*ChainLink) VerifySig

func (c *ChainLink) VerifySig(k PgpKeyBundle) (cached bool, err error)

func (*ChainLink) VerifySigWithKeyFamily

func (c *ChainLink) VerifySigWithKeyFamily(ckf ComputedKeyFamily) (cached bool, err error)

type ChainLinkUnpacked

type ChainLinkUnpacked struct {
	// contains filtered or unexported fields
}

type ChainType

type ChainType struct {
	DbType          ObjType
	Private         bool
	Encrypted       bool
	GetMerkleTriple func(u *MerkleUserLeaf) *MerkleTriple
}
var PublicChain *ChainType = &ChainType{
	DbType:          DB_SIG_CHAIN_TAIL_PUBLIC,
	Private:         false,
	Encrypted:       false,
	GetMerkleTriple: func(u *MerkleUserLeaf) *MerkleTriple { return u.public },
}

type CheckResult

type CheckResult struct {
	Status ProofError // Or nil if it was a success
	Time   time.Time  // When the last check was
}

func NewCheckResult

func NewCheckResult(jw *jsonw.Wrapper) (res *CheckResult, err error)

func NewNowCheckResult

func NewNowCheckResult(pe ProofError) *CheckResult

func (CheckResult) Export

func (cr CheckResult) Export() *keybase_1.CheckResult

func (CheckResult) IsFresh

func (cr CheckResult) IsFresh() bool

func (CheckResult) Pack

func (cr CheckResult) Pack() *jsonw.Wrapper

func (CheckResult) ToDisplayString

func (cr CheckResult) ToDisplayString() string

type Checker

type Checker struct {
	F             func(string) bool
	Hint          string
	PreserveSpace bool
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *ClientConfig, needCookie bool) *Client

type ClientConfig

type ClientConfig struct {
	Host       string
	Port       int
	UseTls     bool
	Url        *url.URL
	RootCAs    *x509.CertPool
	Prefix     string
	UseCookies bool
	Timeout    time.Duration
}

type CoinbaseChecker

type CoinbaseChecker struct {
	// contains filtered or unexported fields
}

func (*CoinbaseChecker) CheckHint

func (rc *CoinbaseChecker) CheckHint(h SigHint) ProofError

func (*CoinbaseChecker) CheckStatus

func (rc *CoinbaseChecker) CheckStatus(h SigHint) ProofError

func (*CoinbaseChecker) ProfileUrl

func (rc *CoinbaseChecker) ProfileUrl() string

type CoinbaseServiceType

type CoinbaseServiceType struct{ BaseServiceType }

func (CoinbaseServiceType) AllStringKeys

func (t CoinbaseServiceType) AllStringKeys() []string

func (CoinbaseServiceType) CheckProofText

func (t CoinbaseServiceType) CheckProofText(text string, id SigId, sig string) (err error)

func (CoinbaseServiceType) CheckUsername

func (t CoinbaseServiceType) CheckUsername(s string) (err error)

func (CoinbaseServiceType) DisplayName

func (t CoinbaseServiceType) DisplayName(un string) string

func (CoinbaseServiceType) GetPrompt

func (t CoinbaseServiceType) GetPrompt() string

func (CoinbaseServiceType) GetProofType

func (t CoinbaseServiceType) GetProofType() string

func (CoinbaseServiceType) GetTypeName

func (t CoinbaseServiceType) GetTypeName() string

func (CoinbaseServiceType) PostInstructions

func (t CoinbaseServiceType) PostInstructions(un string) *Markup

func (CoinbaseServiceType) PrimaryStringKeys

func (t CoinbaseServiceType) PrimaryStringKeys() []string

func (CoinbaseServiceType) RecheckProofPosting

func (t CoinbaseServiceType) RecheckProofPosting(tryNumber, status int) (warning *Markup, err error)

func (CoinbaseServiceType) ToChecker

func (t CoinbaseServiceType) ToChecker() Checker

func (CoinbaseServiceType) ToServiceJson

func (t CoinbaseServiceType) ToServiceJson(un string) *jsonw.Wrapper

type Command

type Command interface {
	GetUsage() Usage
}

type CommandLine

type CommandLine interface {
	GetHome() string
	GetServerUri() string
	GetConfigFilename() string
	GetSessionFilename() string
	GetDbFilename() string
	GetDebug() (bool, bool)
	GetUsername() string
	GetUid() *UID
	GetProxy() string
	GetPlainLogging() (bool, bool)
	GetPgpDir() string
	GetEmail() string
	GetApiDump() (bool, bool)
	GetUserCacheSize() (int, bool)
	GetProofCacheSize() (int, bool)
	GetMerkleKeyFingerprints() []string
	GetPinentry() string
	GetGpg() string
	GetGpgOptions() []string
	GetPgpFingerprint() *PgpFingerprint
	GetSecretKeyring() string
	GetSocketFile() string
	GetDaemonPort() (int, bool)
	GetStandalone() (bool, bool)
	GetLocalRpcDebug() string
	GetPerDeviceKID() string
	GetDeviceId() string
}

type ComputedKeyFamily

type ComputedKeyFamily struct {
	// contains filtered or unexported fields
}

func (*ComputedKeyFamily) Delegate

func (ckf *ComputedKeyFamily) Delegate(tcl TypedChainLink) (err error)

Delegate performs a delegation to the key described in the given TypedChainLink. This maybe be a sub- or sibkey delegation.

func (ComputedKeyFamily) DumpToLog

func (ckf ComputedKeyFamily) DumpToLog(ui LogUI)

DumpToLog dumps info about the current KeyFamily to the given log UI

func (ComputedKeyFamily) FindActiveSibkey

func (ckf ComputedKeyFamily) FindActiveSibkey(f FOKID) (key GenericKey, err error)

func (ComputedKeyFamily) FindKeybaseName

func (ckf ComputedKeyFamily) FindKeybaseName(s string) bool

FindKeybaseName looks at all PGP keys in this key family that are active sibkeys to find a key with a signed identity of <name@keybase.io>. IF found return true, and otherwise false.

func (ComputedKeyFamily) GetActivePgpKeys

func (ckf ComputedKeyFamily) GetActivePgpKeys(sibkey bool) (ret []*PgpKeyBundle)

GetActivePgpKeys gets the active PGP keys from the ComputedKeyFamily. If sibkey is False it will return all active PGP keys. Otherwise, it will return only the Sibkeys.

func (ComputedKeyFamily) GetAllActiveSibkeys

func (ckf ComputedKeyFamily) GetAllActiveSibkeys() (ret []GenericKey)

GetAllActiveSibkeys gets all active Sibkeys from given ComputedKeyFamily, sorted from oldest to newest.

func (ComputedKeyFamily) GetAllActiveSibkeysKIDs

func (ckf ComputedKeyFamily) GetAllActiveSibkeysKIDs() (ret []KID)

GetAllActiveSibkeyKIDs gets all active Sibkeys from given ComputedKeyFamily, sorted from oldest to newest, and returns their KIDs

func (ComputedKeyFamily) HasActiveKey

func (ckf ComputedKeyFamily) HasActiveKey() bool

HasActiveKey returns if the given ComputeKeyFamily has any active keys. The key has to be in the server-given KeyFamily and also in our ComputedKeyFamily. The former check is so that we can handle the case nuked sigchains.

func (ComputedKeyFamily) IsFOKIDActive

func (ckf ComputedKeyFamily) IsFOKIDActive(f FOKID) (ret KeyStatus)

IsFOKIDActive computes whether this FOKID is currently active, and whether as a sibkey or a subkey

func (ComputedKeyFamily) IsKidActive

func (ckf ComputedKeyFamily) IsKidActive(kid KID) (ret KeyStatus)

IsKidActive computes whether the given KID is active, and if so, whether it's a sib or subkey

func (*ComputedKeyFamily) Revoke

func (ckf *ComputedKeyFamily) Revoke(tcl TypedChainLink) (err error)

func (*ComputedKeyFamily) RevokeKid

func (ckf *ComputedKeyFamily) RevokeKid(kid KID, tcl TypedChainLink) (err error)

func (*ComputedKeyFamily) RevokeKids

func (ckf *ComputedKeyFamily) RevokeKids(kids []KID, tcl TypedChainLink) (err error)

func (*ComputedKeyFamily) RevokeSig

func (ckf *ComputedKeyFamily) RevokeSig(sig SigId, tcl TypedChainLink) (err error)

func (*ComputedKeyFamily) RevokeSigs

func (ckf *ComputedKeyFamily) RevokeSigs(sigs []*SigId, tcl TypedChainLink) (err error)

type ComputedKeyInfo

type ComputedKeyInfo struct {
	Status int
	Eldest bool
	Sibkey bool

	// Map of SigId -> KID, both as hex strings
	// (since we can't unmarhsal into KIDs)
	Delegations map[string]string
	DelegatedAt *KeybaseTime
	RevokedAt   *KeybaseTime
}

func (ComputedKeyInfo) Copy

func (cki ComputedKeyInfo) Copy() ComputedKeyInfo

type ComputedKeyInfos

type ComputedKeyInfos struct {

	// Map of KID (in HEX) to a computed info
	Infos map[string]*ComputedKeyInfo

	// Map of a SigId (in Binary) to the ComputedKeyInfo describing when the key was
	// delegated.
	Sigs map[string]*ComputedKeyInfo
	// contains filtered or unexported fields
}

When we play a sigchain forward, it yields ComputedKeyInfos (CKIs). We're going to store CKIs separately from the keys, since the server can clobber the former. We should rewrite CKIs every time we (re)check a user's SigChain

func (ComputedKeyInfos) Copy

func (cki ComputedKeyInfos) Copy() *ComputedKeyInfos

func (*ComputedKeyInfos) Delegate

func (cki *ComputedKeyInfos) Delegate(kid_s string, tm *KeybaseTime, sigid SigId, signingKid KID, isSibkey bool) (err error)

Delegate marks the given ComputedKeyInfos object that the given kid_s is now delegated, as of time tm, in sigid, as signed by signingKid, etc.

func (ComputedKeyInfos) HasActiveKey

func (cki ComputedKeyInfos) HasActiveKey() bool

HasActiveKey returns if the given ComputeKeyInfos has any active keys.

func (*ComputedKeyInfos) Insert

func (cki *ComputedKeyInfos) Insert(f *FOKID, i *ComputedKeyInfo)

Insert inserts the given ComputedKeyInfo object 1 or 2 times, depending on if a KID or PgpFingerprint or both are available.

type ConfigReader

type ConfigReader interface {
	GetHome() string
	GetServerUri() string
	GetConfigFilename() string
	GetSessionFilename() string
	GetDbFilename() string
	GetDebug() (bool, bool)
	GetUsername() string
	GetUid() *UID
	GetProxy() string
	GetPlainLogging() (bool, bool)
	GetPgpDir() string
	GetBundledCA(host string) string
	GetEmail() string
	GetStringAtPath(string) (string, bool)
	GetBoolAtPath(string) (bool, bool)
	GetIntAtPath(string) (int, bool)
	GetNullAtPath(string) bool
	GetUserCacheSize() (int, bool)
	GetProofCacheSize() (int, bool)
	GetMerkleKeyFingerprints() []string
	GetPinentry() string
	GetNoPinentry() (bool, bool)
	GetGpg() string
	GetGpgOptions() []string
	GetPgpFingerprint() *PgpFingerprint
	GetSecretKeyring() string
	GetSalt() []byte
	GetSocketFile() string
	GetDaemonPort() (int, bool)
	GetStandalone() (bool, bool)
	GetLocalRpcDebug() string
	GetPerDeviceKID() string
	GetDeviceId() string
}

type ConfigWriter

type ConfigWriter interface {
	SetUsername(string)
	SetUid(UID)
	SetPgpFingerprint(*PgpFingerprint)
	SetSalt([]byte)
	SetPerDeviceKID(KID) error
	SetDeviceId(*DeviceId) error
	SetStringAtPath(string, string) error
	SetBoolAtPath(string, bool) error
	SetIntAtPath(string, int) error
	SetNullAtPath(string) error
	DeleteAtPath(string)
	Reset()
	Write() error
}
type CryptocurrencyChainLink struct {
	GenericChainLink
	// contains filtered or unexported fields
}
func ParseCryptocurrencyChainLink(b GenericChainLink) (
	cl *CryptocurrencyChainLink, err error)

func (CryptocurrencyChainLink) Display

func (l CryptocurrencyChainLink) Display(ui IdentifyUI)

func (CryptocurrencyChainLink) Export

func (c CryptocurrencyChainLink) Export() (ret keybase_1.Cryptocurrency)

func (CryptocurrencyChainLink) GetAddress

func (c CryptocurrencyChainLink) GetAddress() string

func (*CryptocurrencyChainLink) ToDisplayString

func (r *CryptocurrencyChainLink) ToDisplayString() string

func (*CryptocurrencyChainLink) Type

func (r *CryptocurrencyChainLink) Type() string

type CurrentStatus

type CurrentStatus struct {
	Configured        bool
	Registered        bool
	LoggedIn          bool
	PublicKeySelected bool
	HasPrivateKey     bool
	User              *User
}

func GetCurrentStatus

func GetCurrentStatus() (res CurrentStatus, err error)

func (CurrentStatus) Export

func (c CurrentStatus) Export() (ret keybase_1.GetCurrentStatusRes)

type DbKey

type DbKey struct {
	Typ ObjType
	Key string
}

func DbKeyParse

func DbKeyParse(s string) (string, *DbKey, error)

func (DbKey) ToBytes

func (k DbKey) ToBytes(table string) []byte

func (DbKey) ToString

func (k DbKey) ToString(table string) string

type DeviceId

type DeviceId [DEVICE_ID_LEN]byte

func ImportDeviceId

func ImportDeviceId(s string) (d *DeviceId, err error)

func (DeviceId) String

func (d DeviceId) String() string

type DeviceStatus

type DeviceStatus struct {
	Provisioned  bool
	Keyed        bool
	KeyAvailable bool
}

type DnsChecker

type DnsChecker struct {
	// contains filtered or unexported fields
}

func (*DnsChecker) CheckDomain

func (rc *DnsChecker) CheckDomain(sig string, domain string) ProofError

func (*DnsChecker) CheckHint

func (rc *DnsChecker) CheckHint(h SigHint) ProofError

func (*DnsChecker) CheckStatus

func (rc *DnsChecker) CheckStatus(h SigHint) ProofError

type DnsServiceType

type DnsServiceType struct{ BaseServiceType }

func (DnsServiceType) AllStringKeys

func (t DnsServiceType) AllStringKeys() []string

func (DnsServiceType) CheckProofText

func (t DnsServiceType) CheckProofText(text string, id SigId, sig string) (err error)

func (DnsServiceType) CheckUsername

func (t DnsServiceType) CheckUsername(s string) error

func (DnsServiceType) DisplayName

func (t DnsServiceType) DisplayName(un string) string

func (DnsServiceType) FormatProofText

func (t DnsServiceType) FormatProofText(ppr *PostProofRes) (string, error)

func (DnsServiceType) GetApiArgKey

func (t DnsServiceType) GetApiArgKey() string

func (DnsServiceType) GetPrompt

func (t DnsServiceType) GetPrompt() string

func (DnsServiceType) GetProofType

func (t DnsServiceType) GetProofType() string

func (DnsServiceType) GetTypeName

func (t DnsServiceType) GetTypeName() string

func (DnsServiceType) LastWriterWins

func (t DnsServiceType) LastWriterWins() bool

func (DnsServiceType) NormalizeUsername

func (t DnsServiceType) NormalizeUsername(s string) (string, error)

func (DnsServiceType) PostInstructions

func (t DnsServiceType) PostInstructions(un string) *Markup

func (DnsServiceType) PrimaryStringKeys

func (t DnsServiceType) PrimaryStringKeys() []string

func (DnsServiceType) RecheckProofPosting

func (t DnsServiceType) RecheckProofPosting(tryNumber, status int) (warning *Markup, err error)

func (DnsServiceType) ToChecker

func (t DnsServiceType) ToChecker() Checker

func (DnsServiceType) ToServiceJson

func (t DnsServiceType) ToServiceJson(un string) *jsonw.Wrapper

type EmptyKeyRing

type EmptyKeyRing struct{}

func (EmptyKeyRing) DecryptionKeys

func (k EmptyKeyRing) DecryptionKeys() []openpgp.Key

func (EmptyKeyRing) KeysById

func (k EmptyKeyRing) KeysById(id uint64) []openpgp.Key

func (EmptyKeyRing) KeysByIdUsage

func (k EmptyKeyRing) KeysByIdUsage(id uint64, usage byte) []openpgp.Key

type Env

type Env struct {
	Test TestParameters
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv(cmd CommandLine, config ConfigReader) *Env

func (Env) GenClientConfig

func (e Env) GenClientConfig() (*ClientConfig, error)

Pull the information out of the environment configuration, and build a Client config that will be used in all API server requests

func (Env) GetApiDump

func (e Env) GetApiDump() bool

func (Env) GetBool

func (e Env) GetBool(def bool, flist ...func() (bool, bool)) bool

func (Env) GetBundledCA

func (e Env) GetBundledCA(host string) string

func (Env) GetCacheDir

func (e Env) GetCacheDir() string

func (*Env) GetCommandLine

func (e *Env) GetCommandLine() CommandLine

func (*Env) GetConfig

func (e *Env) GetConfig() ConfigReader

func (Env) GetConfigDir

func (e Env) GetConfigDir() string

func (Env) GetConfigFilename

func (e Env) GetConfigFilename() string

func (*Env) GetConfigWriter

func (e *Env) GetConfigWriter() ConfigWriter

func (Env) GetDaemonPort

func (e Env) GetDaemonPort() int