orckeys

package
v0.0.0-...-b5a46b0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 13 Imported by: 0

README

orckeys: a library to manage a set of cryptographic keys (in Tink format)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEncryptionKeyTemplate = hybrid.ECIESHKDFAES128CTRHMACSHA256KeyTemplate()
View Source
var DefaultSigningKeyTemplate = signature.ECDSAP256KeyTemplate()

Functions

This section is empty.

Types

type Key

type Key struct {
	PublicKey string
	// contains filtered or unexported fields
}

type Keys

type Keys struct {
	Metadata      Metadata
	SigningKey    *Key
	EncryptionKey *Key
	Signer        tink.Signer
	Decrypt       tink.HybridDecrypt
}

func Generate

func Generate(owner string) (*Keys, error)

func LoadEncrypted

func LoadEncrypted(r io.Reader, overrideMasterKeyURI string) (*Keys, error)

func (*Keys) Public

func (k *Keys) Public() PublicKeyPacket

func (*Keys) WriteEncrypted

func (k *Keys) WriteEncrypted(w io.Writer, masterKeyURI string) error

type Metadata

type Metadata struct {
	ID      string `json:"id"`
	Owner   string `json:"owner"`
	Created string `json:"creation_time"`
	Updated string `json:"update_time"`
}

type PrivateKeyPacket

type PrivateKeyPacket struct {
	Metadata             Metadata `json:"metadata"`
	Encrypted            bool     `json:"encrypted"`
	MasterKeyURI         string   `json:"master_key_uri"`
	PrivateSigningKey    []byte   `json:"private_signing_key"`
	PrivateEncryptionKey []byte   `json:"private_encryption_key"`
}

type PublicKeyPacket

type PublicKeyPacket struct {
	Metadata            Metadata `json:"metadata"`
	PublicSigningKey    string   `json:"public_signing_key"`
	PublicEncryptionKey string   `json:"public_encryption_key"`
}

func (PublicKeyPacket) EncryptTo

func (p PublicKeyPacket) EncryptTo() (tink.HybridEncrypt, error)

func (PublicKeyPacket) VerifyFrom

func (p PublicKeyPacket) VerifyFrom() (tink.Verifier, error)

Jump to

Keyboard shortcuts

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