Help us shape the future of Go! Take the 2026 Go Developer Survey

ockam

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

Ockam

Apache 2.0 License Apache 2.0 License GoDoc Discuss Ockam

Introduction

Ockam is a collection of tools to help you establish secure connections and trustful exchange of information within connected systems.

To understand the key ideas behind Ockam, please read our short concept papers of on:

  1. Why we're focusing on the connectivity and messaging layer?
  2. What exactly does trust mean within connected systems?
  3. What are the minimum criteria for establishing trust?

Ockam's core features include:

Secure Identity & Credential Management

  • Decentralized Identifiers: Cryptographically provable, decentralized identifiers (DIDs) for each device to ensure data integrity and protect against identity spoofing.

  • Device And Service Registry: Ockam Blockchain based registry for discovering public keys, protocols, endpoints and other metadata about a device or a service.

  • Hardware Vault And Cryptography: Safely store private keys and credentials in hardware and easily leverage cryptographic modules or enclaves to sign device or service generated data.

  • Key And Credential Management: Easily setup, rotate, revoke keys and other credentials without complex and brittle PKI.

Secure Connectivity & Messaging

  • Trustful Communication: Use Verifiable Credentials and Peer-to-peer Mutual Authentication to establish trust: device-to-device or device-to-service.

  • End-To-End Encrypted Messaging: Secure, efficient and scalable end-to-end encrypted messaging to protect against tampering, replay, snooping and man-in-the-middle attacks.

  • Trusted Twins: Cloud based, persistent, mutually trusted twin of each device so applications can interact with device state and enqueue messages even when a device is offline.

  • Ockam Blockchain Network: A fast finality, safety favouring, light client friendly, and horizontally scalable blockchain network that is optimized for connected devices.

Install

This repository includes a Golang package that can be used to build Go programs (device firmware or a backend service) that act as light nodes on the Ockam Blockchain Network.

With Go version 1.11+ installed, add the ockam Golang package to your project using go get:

go get github.com/ockam-network/ockam

Once you have the ockam package, copy an example from the example directory and run it using go run.

go run example/01_hello_ockam.go

Contribute

Contributors

License and attributions

This code is licensed under the terms of the Apache License 2.0

This code depends on other open source packages; attributions for those packages are in the NOTICE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version returns the current version of Ockam

Types

type Block

type Block interface {
	Height() string
	Hash() string
}

Block represents a block in the Ockam Blockchain

type Chain

type Chain interface {
	ID() string
	Sync() error
	LatestBlock() Block
	Register(Entity) (Claim, error)
	Submit(Claim) error
	FetchClaim(string) ([]byte, Claim, error)
	FetchEntity(string) ([]byte, Entity, error)
}

Chain represents a chain of blocks that is maintained by a network of nodes

type Claim

type Claim interface {
	ID() string
	Nonce() string

	Type() string
	SetType(string)

	Issuer() Entity
	SetIssuer(Entity)

	Subject() Entity
	SetSubject(Entity)

	Data() map[string]interface{}
	SetData(map[string]interface{})

	Signatures() []Signature
	AddSignature(Signature)

	json.Marshaler
}

Claim is

type CommitStore added in v0.3.0

type CommitStore interface {
	Store
	GetLastTrusted() (interface{}, error)
	StoreLastTrusted(lastTrusted interface{}) error
}

type Cryptographer added in v0.3.2

type Cryptographer interface {
	GenerateKeyPair() (publicKey []byte, secretKey []byte, err error)

	AnonymousEncrypt(unencrypted []byte, recipientPublicKey []byte) (encrypted []byte, err error)
	AnonymousDecrypt(encrypted []byte, recipientSecretKey []byte) (unencrypted []byte, err error)

	Sign(message []byte, secretKey []byte) (signed []byte, err error)
	VerifySignature(signed []byte, signerPublicKey []byte) (ok bool, message []byte, err error)

	AuthenticatedEncrypt(unencrypted []byte, senderSecretKey []byte, recipientPublicKey []byte, nonce []byte) (
		encrypted []byte, err error)
	AuthenticatedDecrypt(encrypted []byte, recipientSecretKey []byte, senderPublicKey []byte, nonce []byte) (
		unencrypted []byte, err error)
}

Cryptographer is

type Entity

type Entity interface {
	ID() *did.DID
	PublicKeys() []PublicKey
	Signers() []Signer
	Attributes() map[string]interface{}
}

Entity represents and Ockam entity

type Fields

type Fields map[string]interface{}

Fields is

type Logger

type Logger interface {
	Error(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Notice(format string, v ...interface{})
	Info(format string, v ...interface{})
	Debug(format string, v ...interface{})
	WithFields(fields Fields) Logger
}

Logger is an interface for Logging.

type Node

type Node interface {
	Chain
	Peers() []Node
	Chain() Chain
}

Node represents a node connected to a network of other peer nodes

type NodeDiscoverer

type NodeDiscoverer interface {
	Discover() ([]Node, error)
}

NodeDiscoverer provides the means to discover other nodes on in a network

type PublicKey

type PublicKey interface {
	Label() string
	SetLabel(string)

	Owner() Entity
	SetOwner(Entity)

	Type() string
	Encoding() string
	Value() string

	DID() (*did.DID, error)
}

PublicKey is

type Signer

type Signer interface {
	PublicKey() PublicKey
	Sign(Claim) error
	SignatureType() string
}

Signer is

type Store added in v0.3.0

type Store interface {
	Put(key, value interface{}) error
	Get(key interface{}) (value interface{}, err error)
	Delete(key interface{}) error
}

Directories

Path Synopsis
cmd
ockam command
key
rsa
Package node implements the ockam.Node interface
Package node implements the ockam.Node interface
remote/http
Package http implements ockam.Node interface to enable interaction with a remote node that can be commiunicated with over http.
Package http implements ockam.Node interface to enable interaction with a remote node that can be commiunicated with over http.
Package random is used to generate random bytes and strings.
Package random is used to generate random bytes and strings.
Package test provides utilities for writing tests.
Package test provides utilities for writing tests.
vault
cryptographer command

Jump to

Keyboard shortcuts

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