tinkcrypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 23

Documentation

Overview

Package tinkcrypto provides the default implementation of the common pkg/common/api/crypto.Crypto interface and the SPI pkg/framework/aries.crypto interface

It uses github.com/tink/go crypto primitives

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypto

type Crypto struct {
}

Crypto is the default Crypto SPI implementation using Tink

func New

func New() (*Crypto, error)

New creates a new Crypto instance

func (*Crypto) Decrypt

func (t *Crypto) Decrypt(cipher, nonce, aad []byte, kh interface{}) ([]byte, error)

Decrypt will decrypt cipher using the implementation's corresponding encryption key referenced by kh

func (*Crypto) Encrypt

func (t *Crypto) Encrypt(msg, aad []byte, kh interface{}) ([]byte, []byte, error)

Encrypt will encrypt msg using the implementation's corresponding encryption key and primitive in kh

func (*Crypto) Sign

func (t *Crypto) Sign(msg []byte, kh interface{}) ([]byte, error)

Sign will sign msg using the implementation's corresponding signing key referenced by kh

func (*Crypto) Verify

func (t *Crypto) Verify(sig, msg []byte, kh interface{}) error

Verify will verify sig signature of msg using the implementation's corresponding signing key referenced by kh

Jump to

Keyboard shortcuts

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