pkg

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKeyToPayload

func AddKeyToPayload(payload map[string]interface{}, pubKey jwk.Key) error

func DecryptWithSecretKey added in v0.1.13

func DecryptWithSecretKey(payload []byte, skJWK jwk.Key) ([]byte, error)

func EncryptWithPublicKey

func EncryptWithPublicKey(payload []byte, pkJWK jwk.Key) ([]byte, error)

func GenerateUUID

func GenerateUUID() string

GenerateUUID returns a new random UUID string.

func Hash

func Hash(data []byte) []byte

Hash returns the SHA-256 hash of the input data.

func KeyJWKToJson

func KeyJWKToJson(key jwk.Key) ([]byte, error)

func KeyJsonToJWK

func KeyJsonToJWK(jwkJSON []byte) (jwk.Key, error)

func PublicBytesToECDSA

func PublicBytesToECDSA(data []byte) (*ecdsa.PublicKey, error)

PublicBytesToECDSA elliptic.Marshal and elliptic.Unmarshal are deprecated in favor of the crypto/ecdh package, but that's specifically for ECDH operations. For ECDSA, these functions are still the standard way to handle point marshaling/unmarshaling, so we're good to use them.

func PublicECDSAToBytes

func PublicECDSAToBytes(pub *ecdsa.PublicKey) []byte

PublicECDSAToBytes elliptic.Marshal and elliptic.Unmarshal are deprecated in favor of the crypto/ecdh package, but that's specifically for ECDH operations. For ECDSA, these functions are still the standard way to handle point marshaling/unmarshaling, so we're good to use them.

func ValidatePublicKey

func ValidatePublicKey(curve elliptic.Curve, xBig, yBig *big.Int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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