Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeCompactSignature(sig string) (*protos.Signature, error)
- func EncodeCompactSignature(sig *protos.Signature) (string, error)
- func PrivateKeySign(s Signer, index *big.Int, hash []byte) (*protos.Signature, error)
- func PrivatekeyToString(priv Signer) (string, error)
- func PublicKeyToBytes(pk Verifier) ([]byte, error)
- type Factory
- type Hierarchical
- type Signer
- type Verifier
- func DecodeCompactPublicKey(pk string) (Verifier, error)
- func GetChildPublicKey(pk Verifier, index *big.Int) (Verifier, error)
- func PublicKeyFromBytes(raw []byte) (Verifier, error)
- func PublicKeyFromPBMessage(pubProto *protos.PublicKey) (Verifier, error)
- func PublicKeyFromSignature(sig *protos.Signature) (Verifier, error)
Constants ¶
View Source
const ( SCHEME_ECDSA = "ecdsa" PUBLICKEY_FINGERPRINT_LEN = 8 )
Variables ¶
View Source
var CryptoSchemes = map[string]Factory{}
View Source
var DefaultRandSrc io.Reader
View Source
var DefaultVersion int32
Functions ¶
func DecodeCompactSignature ¶
we define a compact, simple encoding for the protbuf signature before our SDK for other language is mature... which has such a form: <crypto scheme mark>:<encoded sig>:[derived part := <index>,<finger print>,[cc]]
func PrivateKeySign ¶
func PrivatekeyToString ¶
func PublicKeyToBytes ¶
Types ¶
type Hierarchical ¶
type Signer ¶
type Signer interface { Hierarchical Public() Verifier Sign([]byte) (*protos.Signature, error) // contains filtered or unexported methods }
func PrivateKeyFromPBMessage ¶
func PrivateKeyFromPBMessage(privProto *protos.PrivateKey) (Signer, error)
func PrivatekeyFromBytes ¶
func PrivatekeyFromString ¶
type Verifier ¶
type Verifier interface { Hierarchical Verify([]byte, *protos.Signature) bool //the Verifier recovered from signature is not hierarchical Recover(*protos.Signature) error Digest() []byte // contains filtered or unexported methods }
func DecodeCompactPublicKey ¶
func PublicKeyFromBytes ¶
func PublicKeyFromPBMessage ¶
Click to show internal directories.
Click to hide internal directories.