Documentation ¶
Overview ¶
Copyright (C) 2018 go-cloudcard authors
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func GetPublicKey(prikey []byte) ([]byte, error)
- func GetSeed(prikey []byte) ([]byte, error)
- func Sign(priKey []byte, message []byte) []byte
- func Verify(pubKey []byte, message, sig []byte) bool
- type Message
- type PrivateKey
- func (k *PrivateKey) Algorithm() keystore.Algorithm
- func (k *PrivateKey) Clear()
- func (k *PrivateKey) Decode(data []byte) error
- func (k *PrivateKey) Encoded() ([]byte, error)
- func (k *PrivateKey) PublicKey() keystore.PublicKey
- func (k *PrivateKey) Seed() ([]byte, error)
- func (key *PrivateKey) Sign(hash []byte) []byte
- type PublicKey
- type Signature
- func (s *Signature) Algorithm() keystore.Algorithm
- func (s *Signature) InitSign(priv keystore.PrivateKey) error
- func (s *Signature) InitVerify(pub keystore.PublicKey) error
- func (s *Signature) Sign(data []byte) (out keystore.SignResult, err error)
- func (s *Signature) Verify(data []byte, signature keystore.SignResult) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrGetPublicKeyFailed = errors.New("private key to public failed") ErrGetSeedFailed = errors.New("private key to seed failed") )
var ( ErrInvalidPrivateKey = errors.New("invalid private key") ErrInvalidSeed = errors.New("invalid seed") )
Functions ¶
func GetPublicKey ¶
GetPublicKey private key to public key
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func NewPrivateKey ¶
func NewPrivateKey() *PrivateKey
func NewPrivateKeyFromSeed ¶
func NewPrivateKeyFromSeed(seed []byte) (*PrivateKey, error)
func (*PrivateKey) Algorithm ¶
func (k *PrivateKey) Algorithm() keystore.Algorithm
func (*PrivateKey) Decode ¶
func (k *PrivateKey) Decode(data []byte) error
Decode decode data to key
func (*PrivateKey) PublicKey ¶
func (k *PrivateKey) PublicKey() keystore.PublicKey
PublicKey returns publickey
func (*PrivateKey) Sign ¶
func (key *PrivateKey) Sign(hash []byte) []byte
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKey ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature signature ecdsa
func (*Signature) InitSign ¶
func (s *Signature) InitSign(priv keystore.PrivateKey) error
InitSign ed25519 init sign
func (*Signature) InitVerify ¶
InitVerify ed25519 verify init