util

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotSameType      = errors.New("it is not the same type")
	ErrorNotSameSize      = errors.New("it is not the same size")
	ErrorValidationFailed = errors.New("validation failed")
)
View Source
var (
	ErrorKeyMustBePEMEncoded = errors.New("key must be pem encoded")
	ErrorNotECPublicKey      = errors.New("Key is not a valid ECDSA public key")
	ErrorNotECPrivateKey     = errors.New("Key is not a valid ECDSA private key")
	ErrorNotRSAPrivateKey    = errors.New("Key is not a valid RSA private key")
	ErrorNotRSAPublicKey     = errors.New("Key is not a valid RSA public key")
)

ECDSA parsing errors.

Functions

func ArrayCompare added in v1.0.2

func ArrayCompare(v1, v2 interface{}) error

func CompareStringArray added in v1.0.2

func CompareStringArray(v1, v2 []string) error

func Debug added in v1.0.2

func Debug(v ...interface{})

func LiteralToBytes

func LiteralToBytes(v interface{}) ([]byte, bool)

func LiteralToString

func LiteralToString(v interface{}) (string, bool)

func LiteralToStringArray

func LiteralToStringArray(v interface{}) []string

func LiteralToTime

func LiteralToTime(v interface{}) (time.Time, bool)

func ParseECPrivateKeyFromPEM

func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error)

ParseECPrivateKeyFromPEM will parse a PEM encoded EC Private Key Structure.

func ParseECPublicKeyFromPEM

func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error)

ParseECPublicKeyFromPEM will parse a PEM encoded PKCS1 or PKCS8 public key

func ParseRSAPrivateKeyFromPEM

func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)

Parse PEM encoded PKCS1 or PKCS8 private key

func ParseRSAPublicKeyFromPEM

func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)

Parse PEM encoded PKCS1 or PKCS8 public key

func SetDebug added in v1.0.2

func SetDebug(flag bool)

func SetOutput added in v1.0.2

func SetOutput(s string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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