Documentation ¶
Index ¶
- Variables
- func BytesCombine(pBytes ...[]byte) []byte
- func CipherMarshal(data []byte) ([]byte, error)
- func CipherUnmarshal(data []byte) ([]byte, error)
- func Decrypt(pri *PrivateKey, data []byte, mode int) ([]byte, error)
- func DecryptAsn1(pub *PrivateKey, data []byte) ([]byte, error)
- func Encrypt(pub *PublicKey, data []byte, random io.Reader, mode int) ([]byte, error)
- func EncryptAsn1(pub *PublicKey, data []byte, rand io.Reader) ([]byte, error)
- func KeyExchangeResponder(kLen int, ida, idb []byte, priB *PrivateKey, pubA *PublicKey, ...) (k, s1, s2 []byte, err error)
- func KeyExchangeViaInitiator(keyLen int, initiatorId, responderId []byte, initiatorPrivateKey *PrivateKey, ...) (k, s1, s2 []byte, err error)
- func P256Sm2() elliptic.Curve
- func Sign(pri *PrivateKey, msg, uid []byte, random io.Reader) (r, s *big.Int, err error)
- func Verify(pub *PublicKey, msg, uid []byte, r, s *big.Int) bool
- func WNafReversed(wnaf []int8) []int8
- func ZA(pub *PublicKey, uid []byte) ([]byte, error)
- type PrivateKey
- func (pri *PrivateKey) Decrypt(_ io.Reader, msg []byte, _ crypto.DecrypterOpts) (plaintext []byte, err error)
- func (pri *PrivateKey) DecryptAsn1(data []byte) ([]byte, error)
- func (pri *PrivateKey) Encode() ([]byte, error)
- func (pri *PrivateKey) Public() crypto.PublicKey
- func (pri *PrivateKey) Sign(random io.Reader, msg []byte) ([]byte, error)
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( C1C3C2 = 0 C1C2C3 = 1 )
Functions ¶
func BytesCombine ¶
func CipherMarshal ¶
func CipherUnmarshal ¶
func DecryptAsn1 ¶
func DecryptAsn1(pub *PrivateKey, data []byte) ([]byte, error)
func KeyExchangeResponder ¶ added in v1.0.23
func KeyExchangeResponder(kLen int, ida, idb []byte, priB *PrivateKey, pubA *PublicKey, priBTemp *PrivateKey, pubATemp *PublicKey) (k, s1, s2 []byte, err error)
func KeyExchangeViaInitiator ¶ added in v1.0.23
func KeyExchangeViaInitiator(keyLen int, initiatorId, responderId []byte, initiatorPrivateKey *PrivateKey, responderPublicKey *PublicKey, initiatorTempPrivateKey *PrivateKey, responderTempPublicKey *PublicKey) (k, s1, s2 []byte, err error)
func WNafReversed ¶
Types ¶
type PrivateKey ¶
func GenerateKey ¶
func GenerateKey(random io.Reader) (*PrivateKey, error)
func ParsePrivateKey ¶
func ParsePrivateKey(pemBytes []byte) (key *PrivateKey, err error)
func ParsePrivateKeyWithPassword ¶
func ParsePrivateKeyWithPassword(pemBytes []byte, passwd []byte) (key *PrivateKey, err error)
func (*PrivateKey) Decrypt ¶
func (pri *PrivateKey) Decrypt(_ io.Reader, msg []byte, _ crypto.DecrypterOpts) (plaintext []byte, err error)
func (*PrivateKey) DecryptAsn1 ¶
func (pri *PrivateKey) DecryptAsn1(data []byte) ([]byte, error)
func (*PrivateKey) Encode ¶
func (pri *PrivateKey) Encode() ([]byte, error)
func (*PrivateKey) Public ¶
func (pri *PrivateKey) Public() crypto.PublicKey
Click to show internal directories.
Click to hide internal directories.