aead

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2017 License: Apache-2.0 Imports: 9 Imported by: 86

Documentation

Overview

Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

//////////////////////////////////////////////////////////////////////////////

Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

//////////////////////////////////////////////////////////////////////////////

Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

//////////////////////////////////////////////////////////////////////////////

Index

Constants

View Source
const (
	// Supported version
	AES_GCM_KEY_VERSION = 0

	// Supported type url
	AES_GCM_TYPE_URL = "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.

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 (_ *AesGcmKeyManager) DoesSupport(typeUrl string) bool

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

func (*AesGcmKeyManager) GetKeyType

func (_ *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