Documentation ¶
Index ¶
- Constants
- func CheckLowS(vchSig []byte) bool
- func InitPrivateKeyVersion(privateKeyVer byte)
- func InitSecp256()
- func IsCompressedOrUncompressedPubKey(bytes []byte) bool
- func IsCompressedPubKey(bytes []byte) bool
- func IsDefineHashtypeSignature(vchSig []byte) bool
- func IsValidSignatureEncoding(signs []byte) bool
- type KeyPair
- type KeyStore
- type PrivateKey
- func (privateKey *PrivateKey) Encode() []byte
- func (privateKey *PrivateKey) GetBytes() []byte
- func (privateKey *PrivateKey) IsCompressed() bool
- func (privateKey *PrivateKey) PubKey() *PublicKey
- func (privateKey *PrivateKey) Sign(hash []byte) (*Signature, error)
- func (privateKey *PrivateKey) ToString() string
- type PublicKey
- func (publicKey *PublicKey) IsEqual(otherPublicKey *PublicKey) bool
- func (publicKey *PublicKey) SerializeCompressed() []byte
- func (publicKey *PublicKey) SerializeUncompressed() []byte
- func (publicKey *PublicKey) ToBytes() []byte
- func (publicKey *PublicKey) ToHash160() []byte
- func (publicKey *PublicKey) ToHexString() string
- func (publicKey *PublicKey) ToSecp256k() *secp256k1.PublicKey
- func (publicKey *PublicKey) Verify(hash *util.Hash, vchSig []byte) (bool, error)
- type Signature
Constants ¶
View Source
const ( SigHashAll = 1 SigHashNone = 2 SigHashSingle = 3 SigHashForkID = 0x40 SigHashAnyoneCanpay = 0x80 // SigHashMask defines the number of bits of the hash type which is used // to identify which outputs are signed. SigHashMask = 0x1f )
View Source
const ( PrivateKeyBytesLen = 32 DumpedPrivateKeyVersion = 128 )
Variables ¶
This section is empty.
Functions ¶
func InitPrivateKeyVersion ¶ added in v0.0.3
func InitPrivateKeyVersion(privateKeyVer byte)
func InitSecp256 ¶
func InitSecp256()
func IsCompressedPubKey ¶
Types ¶
type KeyPair ¶ added in v0.0.3
type KeyPair struct {
// contains filtered or unexported fields
}
func NewKeyPair ¶ added in v0.0.3
func NewKeyPair(privateKey *PrivateKey) *KeyPair
func (*KeyPair) GetPrivateKey ¶ added in v0.0.3
func (kd *KeyPair) GetPrivateKey() *PrivateKey
func (*KeyPair) GetPublicKey ¶ added in v0.0.3
type KeyStore ¶ added in v0.0.3
func NewKeyStore ¶ added in v0.0.3
func NewKeyStore() *KeyStore
func (*KeyStore) AddKey ¶ added in v0.0.3
func (ks *KeyStore) AddKey(privateKey *PrivateKey)
func (*KeyStore) AddKeyPairs ¶ added in v0.0.3
func (*KeyStore) GetKeyPair ¶ added in v0.0.3
func (*KeyStore) GetKeyPairByPubKey ¶ added in v0.0.3
func (*KeyStore) GetKeyPairs ¶ added in v0.0.3
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func DecodePrivateKey ¶
func DecodePrivateKey(encoded string) (*PrivateKey, error)
func NewPrivateKeyFromBytes ¶ added in v0.0.2
func NewPrivateKeyFromBytes(data []byte, compressed bool) *PrivateKey
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(privateKeyBytes []byte) *PrivateKey
func (*PrivateKey) Encode ¶
func (privateKey *PrivateKey) Encode() []byte
func (*PrivateKey) GetBytes ¶ added in v0.0.2
func (privateKey *PrivateKey) GetBytes() []byte
func (*PrivateKey) IsCompressed ¶ added in v0.0.2
func (privateKey *PrivateKey) IsCompressed() bool
func (*PrivateKey) PubKey ¶
func (privateKey *PrivateKey) PubKey() *PublicKey
func (*PrivateKey) ToString ¶
func (privateKey *PrivateKey) ToString() string
type PublicKey ¶
func ParsePubKey ¶
func (*PublicKey) SerializeCompressed ¶
func (*PublicKey) SerializeUncompressed ¶
func (*PublicKey) ToHexString ¶
func (*PublicKey) ToSecp256k ¶
type Signature ¶
type Signature secp256k1.EcdsaSignature
func ParseDERSignature ¶
func (*Signature) EcdsaNormalize ¶
Click to show internal directories.
Click to hide internal directories.