Documentation ¶
Index ¶
- Constants
- type Factory
- type FactoryED25519
- type FactoryRSA
- type FactoryRSAPSS
- type FactorySECP256K1R
- func (*FactorySECP256K1R) NewPrivateKey() (PrivateKey, error)
- func (f *FactorySECP256K1R) RecoverHashPublicKey(hash, sig []byte) (PublicKey, error)
- func (f *FactorySECP256K1R) RecoverPublicKey(msg, sig []byte) (PublicKey, error)
- func (*FactorySECP256K1R) ToPrivateKey(b []byte) (PrivateKey, error)
- func (*FactorySECP256K1R) ToPublicKey(b []byte) (PublicKey, error)
- type PrivateKey
- type PrivateKeyED25519
- type PrivateKeyRSA
- type PrivateKeyRSAPSS
- type PrivateKeySECP256K1R
- func (k *PrivateKeySECP256K1R) Address() ids.ShortID
- func (k *PrivateKeySECP256K1R) Bytes() []byte
- func (k *PrivateKeySECP256K1R) MarshalJSON() ([]byte, error)
- func (k *PrivateKeySECP256K1R) MarshalText() ([]byte, error)
- func (k *PrivateKeySECP256K1R) PublicKey() PublicKey
- func (k *PrivateKeySECP256K1R) Sign(msg []byte) ([]byte, error)
- func (k *PrivateKeySECP256K1R) SignHash(hash []byte) ([]byte, error)
- func (k *PrivateKeySECP256K1R) String() string
- func (k *PrivateKeySECP256K1R) ToECDSA() *stdecdsa.PrivateKey
- func (k *PrivateKeySECP256K1R) UnmarshalJSON(b []byte) error
- func (k *PrivateKeySECP256K1R) UnmarshalText(text []byte) error
- type PublicKey
- type PublicKeyED25519
- type PublicKeyRSA
- type PublicKeyRSAPSS
- type PublicKeySECP256K1R
- type RecoverableFactory
Constants ¶
View Source
const ( // SECP256K1RSigLen is the number of bytes in a secp2561k recoverable // signature SECP256K1RSigLen = 65 // SECP256K1RSKLen is the number of bytes in a secp2561k recoverable private // key SECP256K1RSKLen = 32 // SECP256K1RPKLen is the number of bytes in a secp2561k recoverable public // key SECP256K1RPKLen = 33 PrivateKeyPrefix = "PrivateKey-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface { NewPrivateKey() (PrivateKey, error) ToPublicKey([]byte) (PublicKey, error) ToPrivateKey([]byte) (PrivateKey, error) }
type FactoryED25519 ¶
type FactoryED25519 struct{}
func (*FactoryED25519) NewPrivateKey ¶
func (*FactoryED25519) NewPrivateKey() (PrivateKey, error)
func (*FactoryED25519) ToPrivateKey ¶
func (*FactoryED25519) ToPrivateKey(b []byte) (PrivateKey, error)
func (*FactoryED25519) ToPublicKey ¶
func (*FactoryED25519) ToPublicKey(b []byte) (PublicKey, error)
type FactoryRSA ¶
type FactoryRSA struct{}
func (*FactoryRSA) NewPrivateKey ¶
func (*FactoryRSA) NewPrivateKey() (PrivateKey, error)
func (*FactoryRSA) ToPrivateKey ¶
func (*FactoryRSA) ToPrivateKey(b []byte) (PrivateKey, error)
func (*FactoryRSA) ToPublicKey ¶
func (*FactoryRSA) ToPublicKey(b []byte) (PublicKey, error)
type FactoryRSAPSS ¶
type FactoryRSAPSS struct{}
func (*FactoryRSAPSS) NewPrivateKey ¶
func (*FactoryRSAPSS) NewPrivateKey() (PrivateKey, error)
func (*FactoryRSAPSS) ToPrivateKey ¶
func (*FactoryRSAPSS) ToPrivateKey(b []byte) (PrivateKey, error)
func (*FactoryRSAPSS) ToPublicKey ¶
func (*FactoryRSAPSS) ToPublicKey(b []byte) (PublicKey, error)
type FactorySECP256K1R ¶
type FactorySECP256K1R struct {
Cache cache.LRU[ids.ID, *PublicKeySECP256K1R]
}
func (*FactorySECP256K1R) NewPrivateKey ¶
func (*FactorySECP256K1R) NewPrivateKey() (PrivateKey, error)
func (*FactorySECP256K1R) RecoverHashPublicKey ¶
func (f *FactorySECP256K1R) RecoverHashPublicKey(hash, sig []byte) (PublicKey, error)
func (*FactorySECP256K1R) RecoverPublicKey ¶
func (f *FactorySECP256K1R) RecoverPublicKey(msg, sig []byte) (PublicKey, error)
func (*FactorySECP256K1R) ToPrivateKey ¶
func (*FactorySECP256K1R) ToPrivateKey(b []byte) (PrivateKey, error)
func (*FactorySECP256K1R) ToPublicKey ¶
func (*FactorySECP256K1R) ToPublicKey(b []byte) (PublicKey, error)
type PrivateKey ¶
type PrivateKeyED25519 ¶
type PrivateKeyED25519 struct {
// contains filtered or unexported fields
}
func (PrivateKeyED25519) Bytes ¶
func (k PrivateKeyED25519) Bytes() []byte
func (*PrivateKeyED25519) PublicKey ¶
func (k *PrivateKeyED25519) PublicKey() PublicKey
type PrivateKeyRSA ¶
type PrivateKeyRSA struct {
// contains filtered or unexported fields
}
func (*PrivateKeyRSA) Bytes ¶
func (k *PrivateKeyRSA) Bytes() []byte
func (*PrivateKeyRSA) PublicKey ¶
func (k *PrivateKeyRSA) PublicKey() PublicKey
type PrivateKeyRSAPSS ¶
type PrivateKeyRSAPSS struct {
// contains filtered or unexported fields
}
func (*PrivateKeyRSAPSS) Bytes ¶
func (k *PrivateKeyRSAPSS) Bytes() []byte
func (*PrivateKeyRSAPSS) PublicKey ¶
func (k *PrivateKeyRSAPSS) PublicKey() PublicKey
type PrivateKeySECP256K1R ¶
type PrivateKeySECP256K1R struct {
// contains filtered or unexported fields
}
func BuildTestKeys ¶ added in v1.8.4
func BuildTestKeys() []*PrivateKeySECP256K1R
func (*PrivateKeySECP256K1R) Address ¶ added in v1.9.2
func (k *PrivateKeySECP256K1R) Address() ids.ShortID
func (*PrivateKeySECP256K1R) Bytes ¶
func (k *PrivateKeySECP256K1R) Bytes() []byte
func (*PrivateKeySECP256K1R) MarshalJSON ¶ added in v1.8.4
func (k *PrivateKeySECP256K1R) MarshalJSON() ([]byte, error)
func (*PrivateKeySECP256K1R) MarshalText ¶ added in v1.8.4
func (k *PrivateKeySECP256K1R) MarshalText() ([]byte, error)
func (*PrivateKeySECP256K1R) PublicKey ¶
func (k *PrivateKeySECP256K1R) PublicKey() PublicKey
func (*PrivateKeySECP256K1R) SignHash ¶
func (k *PrivateKeySECP256K1R) SignHash(hash []byte) ([]byte, error)
func (*PrivateKeySECP256K1R) String ¶ added in v1.8.4
func (k *PrivateKeySECP256K1R) String() string
func (*PrivateKeySECP256K1R) ToECDSA ¶
func (k *PrivateKeySECP256K1R) ToECDSA() *stdecdsa.PrivateKey
ToECDSA returns the ecdsa representation of this private key
func (*PrivateKeySECP256K1R) UnmarshalJSON ¶ added in v1.8.4
func (k *PrivateKeySECP256K1R) UnmarshalJSON(b []byte) error
func (*PrivateKeySECP256K1R) UnmarshalText ¶ added in v1.8.4
func (k *PrivateKeySECP256K1R) UnmarshalText(text []byte) error
type PublicKeyED25519 ¶
type PublicKeyED25519 struct {
// contains filtered or unexported fields
}
func (*PublicKeyED25519) Address ¶
func (k *PublicKeyED25519) Address() ids.ShortID
func (*PublicKeyED25519) Bytes ¶
func (k *PublicKeyED25519) Bytes() []byte
func (*PublicKeyED25519) Verify ¶
func (k *PublicKeyED25519) Verify(msg, sig []byte) bool
func (*PublicKeyED25519) VerifyHash ¶
func (k *PublicKeyED25519) VerifyHash(hash, sig []byte) bool
type PublicKeyRSA ¶
type PublicKeyRSA struct {
// contains filtered or unexported fields
}
func (*PublicKeyRSA) Address ¶
func (k *PublicKeyRSA) Address() ids.ShortID
func (*PublicKeyRSA) Bytes ¶
func (k *PublicKeyRSA) Bytes() []byte
func (*PublicKeyRSA) Verify ¶
func (k *PublicKeyRSA) Verify(msg, sig []byte) bool
func (*PublicKeyRSA) VerifyHash ¶
func (k *PublicKeyRSA) VerifyHash(hash, sig []byte) bool
type PublicKeyRSAPSS ¶
type PublicKeyRSAPSS struct {
// contains filtered or unexported fields
}
func (*PublicKeyRSAPSS) Address ¶
func (k *PublicKeyRSAPSS) Address() ids.ShortID
func (*PublicKeyRSAPSS) Bytes ¶
func (k *PublicKeyRSAPSS) Bytes() []byte
func (*PublicKeyRSAPSS) Verify ¶
func (k *PublicKeyRSAPSS) Verify(msg, sig []byte) bool
func (*PublicKeyRSAPSS) VerifyHash ¶
func (k *PublicKeyRSAPSS) VerifyHash(hash, sig []byte) bool
type PublicKeySECP256K1R ¶
type PublicKeySECP256K1R struct {
// contains filtered or unexported fields
}
func (*PublicKeySECP256K1R) Address ¶
func (k *PublicKeySECP256K1R) Address() ids.ShortID
func (*PublicKeySECP256K1R) Bytes ¶
func (k *PublicKeySECP256K1R) Bytes() []byte
func (*PublicKeySECP256K1R) ToECDSA ¶
func (k *PublicKeySECP256K1R) ToECDSA() *stdecdsa.PublicKey
ToECDSA returns the ecdsa representation of this public key
func (*PublicKeySECP256K1R) Verify ¶
func (k *PublicKeySECP256K1R) Verify(msg, sig []byte) bool
func (*PublicKeySECP256K1R) VerifyHash ¶
func (k *PublicKeySECP256K1R) VerifyHash(hash, sig []byte) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.