crypto

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package crypto is a generated protocol buffer package.

It is generated from these files:

crypto.proto

It has these top-level messages:

Digest256

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TextToPub

func TextToPub(pub string) ([]byte, error)

func Verify

func Verify(pubKey []byte, digest *Digest256, sig []byte) bool

Types

type Digest256

type Digest256 struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func Hash256

func Hash256(data []byte) *Digest256

func NewDigest256

func NewDigest256(bytes []byte) (*Digest256, error)

func TextToDigest256

func TextToDigest256(text string) (*Digest256, error)

func (*Digest256) AsMapKey

func (d *Digest256) AsMapKey() string

func (*Digest256) Descriptor

func (*Digest256) Descriptor() ([]byte, []int)

func (*Digest256) EqualTo

func (d *Digest256) EqualTo(other *Digest256) bool

func (*Digest256) GetData

func (m *Digest256) GetData() []byte

func (Digest256) IsValid

func (d Digest256) IsValid() bool

func (*Digest256) ProtoMessage

func (*Digest256) ProtoMessage()

func (*Digest256) Reset

func (m *Digest256) Reset()

func (*Digest256) String

func (m *Digest256) String() string

func (*Digest256) ToText

func (d *Digest256) ToText() string

type Hasher256

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

func NewHasher256

func NewHasher256() *Hasher256

func (*Hasher256) Feed

func (hasher *Hasher256) Feed(data []byte) *Hasher256

func (*Hasher256) Reset

func (hasher *Hasher256) Reset() *Hasher256

func (*Hasher256) Size

func (hasher *Hasher256) Size() int

func (*Hasher256) Sum

func (hasher *Hasher256) Sum(data []byte) *Digest256

type SecureSigner

type SecureSigner struct {
	Pubkey     []byte
	PubKeyHex  string
	PubkeyHash string

	ServiceId string
	KsUrl     string
	KsPrivKey string
	// contains filtered or unexported fields
}

func NewSecureSigner

func NewSecureSigner(pubkeyHex, pubkeyHash string) *SecureSigner

NewSecureSigner 通过pubkeyhex和pubkeyhash生成一个新的SecureSigner对象。 pubkeyHex是非压缩的公钥

func (*SecureSigner) InitKeystoreParam

func (signer *SecureSigner) InitKeystoreParam(ksPrivKey string, serviceId string, url string)

InitKeystoreParam 初始化访问keystore需要的私钥,仅需调用一次

func (*SecureSigner) Sign

func (signer *SecureSigner) Sign(digest []byte) ([]byte, error)

Sign 访问keystore进行数据加签

type Signer

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

Signer 保存公钥私钥对

func SignerFromText

func SignerFromText(text string) *Signer

func (*Signer) Sign

func (signer *Signer) Sign(digest []byte) ([]byte, error)

Sign 对digest做签名

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL