jwx

package
v0.0.0-...-5d6a5f9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(key interface{}) l.InlineTfunc

Sign creates an InlineTfunc to sign the string of incoming messages

Example
l.New().SetP(func(out chan<- interface{}, errs chan<- error) {
	out <- `{"sub": "1234567890", "name": "John Doe", "iat": 1516239022}` // sign a JWT like payload
	out <- `{"foo": "bar"}`
}).Add(
	l.I(Sign([]byte("secret"))),
	l.Stdout,
).Run()
Output:

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiAiMTIzNDU2Nzg5MCIsICJuYW1lIjogIkpvaG4gRG9lIiwgImlhdCI6IDE1MTYyMzkwMjJ9.TH3DqT4ee58ttaEScoXZQDzCntSvyMaV2L_DLyqjlos
eyJhbGciOiJIUzI1NiJ9.eyJmb28iOiAiYmFyIn0.UeFzIir7vMJQY60bZ-ru2COIheSBQE0ano37obDR1tQ

Types

This section is empty.

Jump to

Keyboard shortcuts

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