aead

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 8 Imported by: 86

Documentation

Overview

Package aead provides implementations of the Aead primitive.

Index

Constants

View Source
const (
	// AesGcmKeyVersion is the maxmimal version of keys that this key manager supports.
	AesGcmKeyVersion = 0

	// AesGcmTypeURL is the url that this key manager supports.
	AesGcmTypeURL = "type.googleapis.com/google.crypto.tink.AesGcmKey"
)

Variables

This section is empty.

Functions

func Aes128GcmKeyTemplate

func Aes128GcmKeyTemplate() *tinkpb.KeyTemplate

Aes128GcmKeyTemplate is a KeyTemplate of AesGcmKey with the following parameters:

  • Key size: 16 bytes

func Aes256GcmKeyTemplate

func Aes256GcmKeyTemplate() *tinkpb.KeyTemplate

Aes256GcmKeyTemplate is a KeyTemplate of AesGcmKey with the following parameters:

  • Key size: 32 bytes

func Config

func Config() *config

Config creates an instance of config if there isn't and returns the instance.

func Factory

func Factory() *factory

Factory creates an instance of factory if there isn't and returns the instance.

func NewAesGcmKey added in v1.1.0

func NewAesGcmKey(version uint32, keyValue []byte) *gcmpb.AesGcmKey

NewAesGcmKey returns a new AesGcmKey.

func NewAesGcmKeyFormat added in v1.1.0

func NewAesGcmKeyFormat(keySize uint32) *gcmpb.AesGcmKeyFormat

NewAesGcmKeyFormat returns a new AesGcmKeyFormat.

Types

type AesGcmKeyManager

type AesGcmKeyManager struct{}

AesGcmKeyManager is an implementation of KeyManager interface. It generates new AesGcmKey keys and produces new instances of AesGcm subtle.

func NewAesGcmKeyManager

func NewAesGcmKeyManager() *AesGcmKeyManager

NewAesGcmKeyManager creates a new aesGcmKeyManager.

func (*AesGcmKeyManager) DoesSupport

func (km *AesGcmKeyManager) DoesSupport(typeURL string) bool

DoesSupport indicates if this key manager supports the given key type.

func (*AesGcmKeyManager) GetKeyType

func (km *AesGcmKeyManager) GetKeyType() string

GetKeyType returns the key type of keys managed by this key manager.

func (*AesGcmKeyManager) GetPrimitiveFromKey

func (km *AesGcmKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)

GetPrimitiveFromKey creates an AesGcm subtle for the given AesGcmKey proto.

func (*AesGcmKeyManager) GetPrimitiveFromSerializedKey

func (km *AesGcmKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)

GetPrimitiveFromSerializedKey creates an AesGcm subtle for the given serialized AesGcmKey proto.

func (*AesGcmKeyManager) NewKeyData

func (km *AesGcmKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)

NewKeyData creates a new KeyData according to specification in the given serialized AesGcmKeyFormat. It should be used solely by the key management API.

func (*AesGcmKeyManager) NewKeyFromKeyFormat

func (km *AesGcmKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)

NewKeyFromKeyFormat creates a new key according to specification in the given AesGcmKeyFormat.

func (*AesGcmKeyManager) NewKeyFromSerializedKeyFormat

func (km *AesGcmKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)

NewKeyFromSerializedKeyFormat creates a new key according to specification the given serialized AesGcmKeyFormat.

Jump to

Keyboard shortcuts

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