cryptoservices

package
v0.0.0-...-5352646 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	DeriveAppSKey(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, jn types.JoinNonce, dn types.DevNonce, nid types.NetID) (types.AES128Key, error)
	// GetAppKey returns the AppKey of the given end device.
	// If the implementation does not expose root keys, this method returns nil, nil.
	GetAppKey(ctx context.Context, dev *ttnpb.EndDevice) (*types.AES128Key, error)
}

Application performs application layer cryptographic operations.

func NewApplicationRPCClient

func NewApplicationRPCClient(cc *grpc.ClientConn, keyVault crypto.KeyVault, callOpts ...grpc.CallOption) Application

NewApplicationRPCClient returns an application service which uses a gRPC service on the given connection.

type Network

type Network interface {
	JoinRequestMIC(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, payload []byte) ([4]byte, error)
	JoinAcceptMIC(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, joinReqType byte, dn types.DevNonce, payload []byte) ([4]byte, error)
	EncryptJoinAccept(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, payload []byte) ([]byte, error)
	EncryptRejoinAccept(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, payload []byte) ([]byte, error)
	DeriveNwkSKeys(ctx context.Context, dev *ttnpb.EndDevice, version ttnpb.MACVersion, jn types.JoinNonce, dn types.DevNonce, nid types.NetID) (NwkSKeys, error)
	// GetNwkKey returns the NwkKey of the given end device.
	// If the implementation does not expose root keys, this method returns nil, nil.
	GetNwkKey(ctx context.Context, dev *ttnpb.EndDevice) (*types.AES128Key, error)
}

Network performs network layer cryptographic operations.

func NewNetworkRPCClient

func NewNetworkRPCClient(cc *grpc.ClientConn, keyVault crypto.KeyVault, callOpts ...grpc.CallOption) Network

NewNetworkRPCClient returns a network service which uses a gRPC service on the given connection.

type NetworkApplication

type NetworkApplication interface {
	Network
	Application
}

NetworkApplication is an interface that combines Network and Application.

func NewMemory

func NewMemory(nwkKey, appKey *types.AES128Key) NetworkApplication

NewMemory returns a network and application service using the given root keys and key vault.

type NwkSKeys

type NwkSKeys struct {
	FNwkSIntKey,
	SNwkSIntKey,
	NwkSEncKey types.AES128Key
}

NwkSKeys contains network session keys.

Jump to

Keyboard shortcuts

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