Documentation ¶
Index ¶
- Constants
- Variables
- func B32ToECDSA(b32 string) string
- func B32ToPGP(b32 string) string
- func B32Type(b32 string) string
- func CheckAllCard(card, cardID string) (string, string, string, error)
- func CheckCard(card, cardID string) (string, string, string, error)
- func CheckGithub(url, ghUID, useruid, fingerprint string) bool
- func CheckHTTPS(url, dnsUID, useruid, fingerprint string) bool
- func CheckLinkedin(url, lkUID, useruid, fingerprint string) bool
- func CheckTwitter(url, twUID, useruid, fingerprint string) bool
- func DelStore(name string)
- func ECDSAExport(privkey string) (string, error)
- func ECDSAFingerprint(key string) (string, error)
- func ECDSAImport(b64u string) (string, error)
- func ECDSASign(privkey, message string) (string, error)
- func ECDSAToB32(ecdsa string) string
- func ECDSAVerify(pubkey, message, signature string) (bool, error)
- func HTTPCard(keyuid, token string) (string, error)
- func HTTPKey(keyuid string) (string, error)
- func IsInBatch(data, hash string) bool
- func IsSha256(value string) bool
- func Keccak256(text string) string
- func ListFilesInDirectory(root string) ([]string, error)
- func LoadB64U(data string) (string, string, error)
- func LoadFioContent(content string) (ktype, keyuid, privkey, pubkey string, err error)
- func LoadFioFile(filepath string) (string, string, string, string, error)
- func PGPExport(key string) string
- func PGPFingerprint(key string) (string, error)
- func PGPImport(key string) (string, error)
- func PGPSign(message, privkey, passphrase string) (string, error)
- func PGPToB32(pgp string) string
- func PGPVerify(signature, message, pubkey string) (bool, error)
- func PostWithToken(c *http.Client, url string, token string, body io.Reader) (resp *http.Response, err error)
- func RawSha256(text string) []byte
- func Sha1(text string) string
- func Sha256(text string) string
- func Sha256B(data []byte) [32]byte
- func Sha256File(filepath string) (string, error)
- func VerifySignature(ktype, pubkey, message, signature string) (bool, error)
- type BatchElem
- type CardData
- type CardReq
- type ECDSAFIO
- type ECDSAJWK
- type ErrorRes
- type FBKError
- type GistData
- type JSONRes
- type JWKKey
- type KeyFIO
- type KeyResponseData
- type Metadata
- type OwnerData
- type ProviderData
- type ProviderInfo
- type ProviderState
- type ProviderStates
- type Store
Constants ¶
const ( None = 0 InvalidAuthentication = 10 InvalidKey = 11 InvalidCard = 12 InvalidProof = 13 InvalidSignature = 14 InvalidPassphrase = 15 InvalidProject = 16 InvalidHash = 17 InvalidFile = 18 InvalidJSON = 19 InvalidEncoding = 21 NetworkError = 30 NetworkError404 = 31 NoFile = 32 SignError = 40 APIError = 50 AlreadyExist = 60 UnknownError = 90 UnknownElement = 91 UnknownProvider = 92 EthOpError = 100 EthNotEnoughGas = 101 NotYetImplemented = 127 )
Errors
Variables ¶
var ServerURL = "https://fireblock.io"
ServerURL is the url of the service
Functions ¶
func CheckAllCard ¶
CheckAllCard verify sha3(card)==cardId then the proofs and return useruid, pubkey, ktype check the key in the blockchain
func CheckCard ¶
CheckCard verify sha3(card)==cardId then the proofs and return useruid, keyuid, ktype Don't check the key in the blockchain
func CheckGithub ¶
CheckGithub Check github proof
func CheckHTTPS ¶
CheckHTTPS check website with a https proof
func CheckLinkedin ¶
CheckLinkedin check a linkedin proof
func CheckTwitter ¶
CheckTwitter check twitter proof
func ECDSAExport ¶
ECDSAExport export a JSON key into a base64url key
func ECDSAFingerprint ¶
ECDSAFingerprint compute a fingerprint
func ECDSAImport ¶
ECDSAImport import a base64 encoded url key
func ECDSAVerify ¶
ECDSAVerify verify a signed message
func ListFilesInDirectory ¶
ListFilesInDirectory recursive
func LoadFioContent ¶
LoadFioContent load a fio content
func LoadFioFile ¶
LoadFioFile load a fio file
func PGPFingerprint ¶
PGPFingerprint get fingerprint of pgp key
func PostWithToken ¶
func PostWithToken(c *http.Client, url string, token string, body io.Reader) (resp *http.Response, err error)
PostWithToken post
func Sha256File ¶
Sha256File compute the sha256 of a file
func VerifySignature ¶
VerifySignature verify signature
Types ¶
type BatchElem ¶
type BatchElem struct { Hash string `json:"h"` Filename string `json:"f,omitempty"` Type string `json:"t,omitempty"` Size int64 `json:"s"` }
BatchElem batch element
type ECDSAJWK ¶
type ECDSAJWK struct { Crv string `json:"crv"` Kty string `json:"kty"` X string `json:"x"` Y string `json:"y"` D string `json:"d,omitempty"` Keyops []string `json:"key_ops,omitempty"` }
ECDSAJWK ecdsa jwk
type FBKError ¶
type FBKError struct {
// contains filtered or unexported fields
}
FBKError struct
func NewFBKError ¶
NewFBKError default Constructor
type GistData ¶
type GistData struct { Owner OwnerData `json:"owner"` ForkOf json.RawMessage `json:"fork_of"` }
GistData Gist information
type JSONRes ¶
type JSONRes struct { Errors []ErrorRes `json:"errors"` Data json.RawMessage `json:"data"` }
JSONRes is a common struct used in json response
type JWKKey ¶
type JWKKey struct { D string `json:"d,omitempty"` Crv string `json:"crv"` Ext bool `json:"ext"` KeyOps []string `json:"key_ops"` Kty string `json:"kty"` X string `json:"x"` Y string `json:"y"` }
JWKKey a key
type KeyFIO ¶
type KeyFIO struct { Pubkey string `json:"pubkey"` Privkey string `json:"privkey"` KeyUID string `json:"keyuid"` KType string `json:"ktype"` }
KeyFIO key fio
type KeyResponseData ¶
type KeyResponseData struct { ID string `json:"id"` Key []interface{} `json:"key"` }
KeyResponseData is a common struct used in success response
type Metadata ¶
type Metadata struct { Kind string `json:"kind,omitempty"` Filename string `json:"filename,omitempty"` Type string `json:"type,omitempty"` Size int64 `json:"size"` }
Metadata meta data
func MetadataFile ¶
MetadataFile extract Metadata from file
type ProviderData ¶
type ProviderData struct { UID string `json:"uid"` Provider string `json:"provider"` Date string `json:"date"` Proof string `json:"proof"` }
ProviderData provider struct
type ProviderInfo ¶
type ProviderInfo struct { UID string // contains filtered or unexported fields }
type ProviderState ¶
type ProviderState struct {
UID, Proof, Status string
}
type ProviderStates ¶
type ProviderStates struct {
Twitter, Github, Linkedin, Https ProviderState
}
func VerifyCard ¶
func VerifyCard(card, pkeyUID, pktype string) (pstates *ProviderStates, err error)
status, provider states, error