crypto

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bech32Decode added in v0.1.12

func Bech32Decode(in string) (interface{}, error)

Bech32Decode decodes given bech32 encoded string.

func DecryptJWE added in v0.1.12

func DecryptJWE(key, token string) (interface{}, error)

DecryptJWE decrypt a JWE token.

func EncryptJWE added in v0.1.12

func EncryptJWE(key string, payload interface{}) (string, error)

EncryptJWE encrypts input as JWE token.

func EncryptPEM

func EncryptPEM(pemData, passphrase string) (string, error)

EncryptPEM returns an encrypted PEM block using the given passphrase.

func FromJWK added in v0.1.12

func FromJWK(jwk string) (interface{}, error)

FromJWK parses a JWK and return wrapped keys.

func Key

func Key(keyType string) (string, error)

Key generates symmetric encryption keys according to given keyType.

func KeyToBytes added in v0.1.12

func KeyToBytes(key interface{}) ([]byte, error)

KeyToBytes encodes the given crypto key as a byte array.

func Keypair

func Keypair(keyType string) (interface{}, error)

Keypair generates crypto keys according to given key type.

func ParseJWT added in v0.2.5

func ParseJWT(token string) (interface{}, error)

ParseJWT unpack a JWT without signature verification.

func ToJWK

func ToJWK(key interface{}) (string, error)

ToJWK encodes given key using JWK.

func ToJWS added in v0.1.12

func ToJWS(payload, privkey interface{}) (string, error)

ToJWS returns a JWT token.

func ToPEM

func ToPEM(key interface{}) (string, error)

ToPEM encodes the given key using PEM.

func ToSSH

func ToSSH(key interface{}) (string, error)

ToSSH encodes the given key as SSH key.

func ToTLSA added in v0.2.5

func ToTLSA(selector, mtype uint8, cert *x509.Certificate) (string, error)

ToTLSA encodes the given certificate using TLSA encoding strategy. selector 0 - Raw / 1 - Public Key mtype 0 - Raw / 1 - SHA256 / 2 - SHA512

func VerifyJWT added in v0.2.5

func VerifyJWT(token string, key interface{}) (interface{}, error)

Types

This section is empty.

Directories

Path Synopsis
Package bech32 is a modified version of the reference implementation of BIP173.
Package bech32 is a modified version of the reference implementation of BIP173.
paseto
v4

Jump to

Keyboard shortcuts

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