keys

package
Version: v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 3 Imported by: 24

Documentation

Index

Constants

View Source
const (
	TypeEC = iota
	TypeRSA
)

Type of Themis key.

View Source
const (
	KEYTYPE_EC  = TypeEC
	KEYTYPE_RSA = TypeRSA
)

Type of Themis key.

Deprecated: Since 0.11. Use "keys.Type..." constants instead.

Variables

View Source
var (
	ErrGetKeySize      = errors.New("failed to get needed key sizes")
	ErrGenerateKeypair = errors.New("failed to generate keypair")
	ErrInvalidType     = errors.NewWithCode(errors.InvalidParameter, "invalid key type specified")
	ErrOutOfMemory     = errors.NewWithCode(errors.NoMemory, "key generator cannot allocate enough memory")
	// Deprecated: Since 0.14. Use ErrOutOfMemory instead.
	ErrOverflow = ErrOutOfMemory
)

Errors returned by key generation.

View Source
var (
	ErrGetSymmetricKeySize  = errors.New("failed to get symmetric key size")
	ErrGenerateSymmetricKey = errors.New("failed to generate symmetric key")
)

Errors returned by key generation.

Functions

This section is empty.

Types

type Keypair

type Keypair struct {
	Private *PrivateKey
	Public  *PublicKey
}

Keypair stores a ECDSA or RSA key pair.

func New

func New(keytype int) (*Keypair, error)

New generates a new random pair of keys of the specified type.

type PrivateKey

type PrivateKey struct {
	Value []byte
}

PrivateKey stores a ECDSA or RSA private key.

type PublicKey

type PublicKey struct {
	Value []byte
}

PublicKey stores a ECDSA or RSA public key.

type SymmetricKey added in v0.13.0

type SymmetricKey struct {
	Value []byte
}

SymmetricKey stores a master key for Secure Cell.

func NewSymmetricKey added in v0.13.0

func NewSymmetricKey() (*SymmetricKey, error)

NewSymmetricKey generates a new random symmetric key.

Jump to

Keyboard shortcuts

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