Documentation ¶
Index ¶
- Constants
- Variables
- func IsLowS(s *big.Int) bool
- func MarshalECDSASignature(r, s *big.Int) ([]byte, error)
- func New(sub []byte)
- func NewEcdsaValidator() core.Validator
- func SerializePrivateKey(p *ecdsa.PrivateKey) []byte
- func SerializePublicKeyCompressed(p *ecdsa.PublicKey) []byte
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) *big.Int
- func UnmarshalECDSASignature(raw []byte) (*big.Int, *big.Int, error)
- type Driver
- func (d Driver) GenKey() (crypto.PrivKey, error)
- func (d Driver) PrivKeyFromBytes(b []byte) (privKey crypto.PrivKey, err error)
- func (d Driver) PubKeyFromBytes(b []byte) (pubKey crypto.PubKey, err error)
- func (d Driver) SignatureFromBytes(b []byte) (sig crypto.Signature, err error)
- func (d Driver) Validate(msg, pub, sig []byte) error
- type PrivKeyECDSA
- type PubKeyECDSA
- type SignatureECDSA
- type SignatureS
Constants ¶
const ID = 257
ID id
const Name = "secp256r1"
Name name
Variables ¶
var EcdsaAuthor = authority.Authority{}
EcdsaAuthor secp256r1证书校验
Functions ¶
func MarshalECDSASignature ¶
MarshalECDSASignature marshal ECDSA signature
func NewEcdsaValidator ¶ added in v1.65.3
NewEcdsaValidator 创建ecdsa校验器
func SerializePrivateKey ¶
func SerializePrivateKey(p *ecdsa.PrivateKey) []byte
SerializePrivateKey serialize private key
func SerializePublicKeyCompressed ¶
SerializePublicKeyCompressed serialize compressed publicKey
Types ¶
type Driver ¶
type Driver struct{}
Driver driver
func (Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes create private key from bytes
func (Driver) PubKeyFromBytes ¶
PubKeyFromBytes create public key from bytes
func (Driver) SignatureFromBytes ¶
SignatureFromBytes create signature from bytes
type PrivKeyECDSA ¶
type PrivKeyECDSA [privateKeyECDSALength]byte
PrivKeyECDSA PrivKey
func (PrivKeyECDSA) Equals ¶
func (privKey PrivKeyECDSA) Equals(other crypto.PrivKey) bool
Equals check privkey is equal
func (PrivKeyECDSA) PubKey ¶
func (privKey PrivKeyECDSA) PubKey() crypto.PubKey
PubKey convert to public key
type PubKeyECDSA ¶
type PubKeyECDSA [publicKeyECDSALengthCompressed]byte
PubKeyECDSA PubKey prefixed with 0x02 or 0x03, depending on the y-cord.
func (PubKeyECDSA) Equals ¶
func (pubKey PubKeyECDSA) Equals(other crypto.PubKey) bool
Equals check public key is equal
func (PubKeyECDSA) KeyString ¶
func (pubKey PubKeyECDSA) KeyString() string
KeyString Must return the full bytes in hex. Used for map keying, etc.
func (PubKeyECDSA) VerifyBytes ¶
func (pubKey PubKeyECDSA) VerifyBytes(msg []byte, sig crypto.Signature) bool
VerifyBytes verify signature
type SignatureECDSA ¶
type SignatureECDSA []byte
SignatureECDSA Signature
func (SignatureECDSA) Bytes ¶
func (sig SignatureECDSA) Bytes() []byte
Bytes convert signature to bytes
func (SignatureECDSA) Equals ¶
func (sig SignatureECDSA) Equals(other crypto.Signature) bool
Equals check signature equals
func (SignatureECDSA) IsZero ¶
func (sig SignatureECDSA) IsZero() bool
IsZero check signature is zero
func (SignatureECDSA) String ¶
func (sig SignatureECDSA) String() string
String convert signature to string