ectoken

package
v0.0.0-...-8e08c53 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0, MIT Imports: 8 Imported by: 3

README

EdgeCast Token Authentication extension for Go

Written against Go 1.10, but is expected to work with older versions.

To build and install the test utility, simply run 'go get -u github.com/VerizonDigital/ectoken/go-ectoken/ectoken'

Command-line usage for encrypting and decrypting is as follows:

 To Encrypt:
     ec_encrypt <key> <text>
 or:
     ec_encrypt encrypt <key> <text>
 To Decrypt:
     ec_encrypt decrypt <key> <text>

For instance, using an encryption key of "testkey123":

$ ./ectoken encrypt testkey123 'ec_expire=1257642471&ec_secure=33' af0c6acf7906cd500aee63a4dd2e97ddcb0142601cf83aa9d622289718c4c85413

$ ./ectoken decrypt testkey123 af0c6acf7906cd500aee63a4dd2e97ddcb0142601cf83aa9d622289718c4c85413 ec_expire=1257642471&ec_secure=33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptV3

func DecryptV3(key, token string) (string, error)

* DecryptV3 decrypts the given token using the supplied key. On success, * returns the decrypted content and a nil error. If the token is invalid or * can not be decrypted, returns an empty string and a non-nil error.

func EncryptV3

func EncryptV3(key, token string) string

* EncryptV3 encrypts the given content using the supplied key.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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