secsipid

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: GPL-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SJWTBase64DecodeBytes

func SJWTBase64DecodeBytes(seg string) ([]byte, error)

SJWTBase64DecodeBytes takes in a base 64 encoded string and returns the actual bytes array or an error of it fails to decode the string

func SJWTBase64DecodeString

func SJWTBase64DecodeString(src string) (string, error)

SJWTBase64DecodeString takes in a base 64 encoded string and returns the actual string or an error of it fails to decode the string

func SJWTBase64EncodeBytes

func SJWTBase64EncodeBytes(seg []byte) string

SJWTBase64EncodeBytes encode bytes array to base64 with padding stripped

func SJWTBase64EncodeString

func SJWTBase64EncodeString(src string) string

SJWTBase64EncodeString encode string to base64 with padding stripped

func SJWTCheckFullIdentity

func SJWTCheckFullIdentity(identityVal string, expireVal int, pubkeyPath string, timeoutVal int) (int, error)

SJWTCheckFullIdentity - implements the verify of identity

func SJWTCheckFullIdentityURL

func SJWTCheckFullIdentityURL(identityVal string, expireVal int, timeoutVal int) (int, error)

SJWTCheckFullIdentityURL - implements the verify of identity using URL

func SJWTCheckIdentity

func SJWTCheckIdentity(identityVal string, expireVal int, pubkeyPath string, timeoutVal int) (int, error)

SJWTCheckIdentity - implements the verify of identity

func SJWTEncode

func SJWTEncode(header SJWTHeader, payload SJWTPayload, prvkey interface{}) string

SJWTEncode - encode payload to JWT

func SJWTEncodeText

func SJWTEncodeText(headerJSON string, payloadJSON string, prvkeyPath string) (string, error)

SJWTEncodeText - encode header and payload to JWT

func SJWTGetIdentity

func SJWTGetIdentity(origTN string, destTN string, attestVal string, origID string, x5uVal string, prvkeyPath string) (string, error)

SJWTGetIdentity --

func SJWTGetURLContent

func SJWTGetURLContent(urlVal string, timeoutVal int) ([]byte, error)

SJWTGetURLContent --

func SJWTParseECPrivateKeyFromPEM

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

SJWTParseECPrivateKeyFromPEM Parse PEM encoded Elliptic Curve Private Key Structure

func SJWTParseECPublicKeyFromPEM

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

SJWTParseECPublicKeyFromPEM Parse PEM encoded PKCS1 or PKCS8 public key

func SJWTRemoveWhiteSpaces

func SJWTRemoveWhiteSpaces(s string) string

SJWTRemoveWhiteSpaces --

func SJWTSignWithPrvKey

func SJWTSignWithPrvKey(signingString string, key interface{}) (string, error)

SJWTSignWithPrvKey - implements the signing For this signing method, key must be an ecdsa.PrivateKey struct

func SJWTVerifyWithPubKey

func SJWTVerifyWithPubKey(signingString string, signature string, key interface{}) (int, error)

SJWTVerifyWithPubKey - implements the verify For this verify method, key must be an ecdsa.PublicKey struct

Types

type SJWTDest

type SJWTDest struct {
	TN []string `json:"tn"`
}

SJWTDest --

type SJWTHeader

type SJWTHeader struct {
	Alg string `json:"alg"`
	Ppt string `json:"ppt"`
	Typ string `json:"typ"`
	X5u string `json:"x5u"`
}

SJWTHeader - header for JWT

type SJWTOrig

type SJWTOrig struct {
	TN string `json:"tn"`
}

SJWTOrig --

type SJWTPayload

type SJWTPayload struct {
	ATTest string   `json:"attest"`
	Dest   SJWTDest `json:"dest"`
	IAT    int64    `json:"iat"`
	Orig   SJWTOrig `json:"orig"`
	OrigID string   `json:"origid"`
}

SJWTPayload - JWT payload

func SJWTDecodeWithPubKey

func SJWTDecodeWithPubKey(jwt string, expireVal int, pubkey interface{}) (*SJWTPayload, error)

SJWTDecodeWithPubKey - decode JWT string

func SJWTGetValidPayload

func SJWTGetValidPayload(base64Payload string, expireVal int) (*SJWTPayload, error)

SJWTGetValidPayload --

Jump to

Keyboard shortcuts

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