tokenaccessor

package
v10.299.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenAccessor

type TokenAccessor interface {
	GetTokenValidity() time.Duration
	GetTokenServerID() string

	// Token creation methods.
	CreateAckPacketToken(proto314 bool, secretKey []byte, claims *tokens.ConnectionClaims, encodedBuf []byte) ([]byte, error)
	CreateSynPacketToken(claims *tokens.ConnectionClaims, encodedBuf []byte, nonce []byte, claimsHeader *claimsheader.ClaimsHeader, secrets secrets.Secrets) ([]byte, error)

	CreateSynAckPacketToken(proto314 bool, claims *tokens.ConnectionClaims, encodedBuf []byte, nonce []byte, claimsHeader *claimsheader.ClaimsHeader, secrets secrets.Secrets, secretKey []byte) ([]byte, error)
	// Token parsing methods.
	ParsePacketToken(privateKey *ephemeralkeys.PrivateKey, data []byte, secrets secrets.Secrets, c *tokens.ConnectionClaims, b bool) ([]byte, *claimsheader.ClaimsHeader, *pkiverifier.PKIControllerInfo, []byte, string, bool, error)
	ParseAckToken(proto314 bool, secretKey []byte, nonce []byte, data []byte, connClaims *tokens.ConnectionClaims) error

	Randomize([]byte, []byte) error
	Sign([]byte, *ecdsa.PrivateKey) ([]byte, error)
}

TokenAccessor define an interface to access LockedTokenEngine

func New

func New(serverID string, validity time.Duration, secret secrets.Secrets) (TokenAccessor, error)

New creates a new instance of TokenAccessor interface

Directories

Path Synopsis
Package mocktokenaccessor is a generated GoMock package.
Package mocktokenaccessor is a generated GoMock package.

Jump to

Keyboard shortcuts

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