crypto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64URLDecode added in v0.2.6

func Base64URLDecode(data string) ([]byte, error)

Base64URLDecode Decode Base64URL string to bytes

func Base64URLEncode added in v0.2.6

func Base64URLEncode(data []byte) string

Base64URLEncode Encode bytes to Base64URL string

func DeepHash

func DeepHash(data any) [48]byte

DeepHash is a hash algorithm which takes a nested list of values as input and produces a 384 bit hash, where a change of any value or the structure will affect the hash. https://www.arweave.org/yellow-paper.pdf

func GetAddressFromOwner added in v0.1.2

func GetAddressFromOwner(owner string) (string, error)

GetAddressFromOwner - Convert the 512 byte owner to the Arweave public address

func GetAddressFromPublicKey added in v0.1.2

func GetAddressFromPublicKey(p *rsa.PublicKey) string

GetAddressFromPublicKey - Convert the RSA Public Key to the Arweave public address

func GetPublicKeyFromOwner added in v0.1.2

func GetPublicKeyFromOwner(owner string) (*rsa.PublicKey, error)

GetPublicKeyFromOwner - Convert the 512 byte owner from the Public

func SHA256

func SHA256(data []byte) []byte

SHA256 - Convert raw binary data to SHA256 hashed bytes. This is convenience function for the library.

func Sign

func Sign(data []byte, privateKey *rsa.PrivateKey) ([]byte, error)

Sign to sign any data using your Arweave RSA Private Key

func Verify

func Verify(data []byte, signature []byte, publicKey *rsa.PublicKey) error

Verify to verify any data using the provided Arweave RSA Public Key

Types

This section is empty.

Jump to

Keyboard shortcuts

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