crypto

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotECDSAPrivateKey = errors.New("not ECDSA private key")

ErrNotECDSAPrivateKey occurs when the private key is not a ECDSA one.

View Source
var ErrNotPEMEncoded = errors.New("not pem encoded")

ErrNotPEMEncoded occurs when the content is not PEM encoded.

Functions

func HMACSHA256String

func HMACSHA256String(secret []byte, body []byte) string

HMACSHA256String returns the hex-encoded string of HMAC-SHA256 code of body using secret as key.

func ParseAppleP8PrivateKey

func ParseAppleP8PrivateKey(content []byte) (privateKey *ecdsa.PrivateKey, err error)

ParseAppleP8PrivateKey parses the .p8 private key generated by Apple.

func SHA256String

func SHA256String(s string) string

SHA256String returns the hex hash of s.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL