crypto

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 20 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 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.

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.

Jump to

Keyboard shortcuts

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