cryptoutil

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Overview

Package cryptoutil provides utility functions for cryptographic operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sha256Hash added in v0.0.60

func Sha256Hash(msg []byte) []byte

Sha256Hash returns the SHA-256 hash of a message as a byte slice.

func SignSymmetric added in v0.0.12

func SignSymmetric(msg []byte, secretKey *[32]byte) ([]byte, error)

SignSymmetric signs a message using a symmetric key. It is a convenience wrapper around the nacl/auth package.

func VerifyAndReadAssymetric added in v0.0.20

func VerifyAndReadAssymetric(signedMsg []byte, publicKey *[32]byte) ([]byte, error)

VerifyAndReadAssymetric verifies a signed message using a public key and returns the original message. It is a convenience wrapper around the nacl/sign package.

func VerifyAndReadAssymetricBase64 added in v0.0.57

func VerifyAndReadAssymetricBase64(signedMsg Base64, publicKey Base64) ([]byte, error)

VerifyAndReadAssymetricBase64 verifies a signed message using a base64 encoded public key and returns the original message. It is a convenience wrapper around the nacl/sign package.

func VerifyAndReadSymmetric added in v0.0.20

func VerifyAndReadSymmetric(signedMsg []byte, secretKey *[32]byte) ([]byte, error)

VerifyAndReadSymmetric verifies a signed message using a symmetric key and returns the original message. It is a convenience wrapper around the nacl/auth package.

Types

type Base64 added in v0.0.57

type Base64 = string

Jump to

Keyboard shortcuts

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