Documentation ¶
Index ¶
- func MarshalXMLPrivateKey(key *PrivateKey) ([]byte, error)
- func MarshalXMLPublicKey(key *PublicKey) ([]byte, error)
- func Sign(random io.Reader, priv *PrivateKey, hash []byte) (*big.Int, *big.Int, error)
- func SignASN1(rand io.Reader, priv *PrivateKey, hash []byte) ([]byte, error)
- func Verify(pub *PublicKey, hash []byte, r, s *big.Int) (bool, error)
- func VerifyASN1(pub *PublicKey, hash, sig []byte) (bool, error)
- type PrivateKey
- type PublicKey
- type XMLKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalXMLPrivateKey ¶
func MarshalXMLPrivateKey(key *PrivateKey) ([]byte, error)
func MarshalXMLPublicKey ¶
Types ¶
type PrivateKey ¶
egdsa PrivateKey
func GenerateKey ¶
func GenerateKey(random io.Reader, bitsize, probability int) (*PrivateKey, error)
GenerateKey generates egdsa private key according to given bit size and probability.
func ParseXMLPrivateKey ¶
func ParseXMLPrivateKey(der []byte) (*PrivateKey, error)
func (*PrivateKey) Equal ¶
func (priv *PrivateKey) Equal(x crypto.PrivateKey) bool
Equal reports whether priv and x have the same value.
func (*PrivateKey) Public ¶
func (priv *PrivateKey) Public() crypto.PublicKey
Public returns the public key corresponding to priv.
func (*PrivateKey) Sign ¶
func (priv *PrivateKey) Sign(random io.Reader, hash []byte, opts crypto.SignerOpts) (signature []byte, err error)
Signature generates signature over the given hash. It returns signature value consisting of two parts "r" and "s" as byte arrays.
type PublicKey ¶
egdsa PublicKey
func ParseXMLPublicKey ¶
type XMLKey ¶
type XMLKey struct{}
*
- egdsa xml密钥 *
- @create 2024-8-12
- @author deatil
func (XMLKey) MarshalPrivateKey ¶
func (this XMLKey) MarshalPrivateKey(key *PrivateKey) ([]byte, error)
包装私钥
func (XMLKey) MarshalPublicKey ¶
包装公钥
func (XMLKey) ParsePrivateKey ¶
func (this XMLKey) ParsePrivateKey(data []byte) (*PrivateKey, error)
解析私钥
Click to show internal directories.
Click to hide internal directories.