testutil

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: 16 Imported by: 0

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.

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAesGcmKey

func NewAesGcmKey(keySize uint32) *AesGcmKey

func NewAesGcmKeyData

func NewAesGcmKeyData(keySize uint32) *KeyData

func NewDummyKey

func NewDummyKey(keyId int, status KeyStatusType, outputPrefixType OutputPrefixType) *Keyset_Key

func NewEcdsaPrivateKey

func NewEcdsaPrivateKey(hashType HashType, curve EllipticCurveType) *EcdsaPrivateKey

func NewEcdsaPrivateKeyData

func NewEcdsaPrivateKeyData(hashType HashType, curve EllipticCurveType) *KeyData

func NewEcdsaPublicKey

func NewEcdsaPublicKey(hashType HashType, curve EllipticCurveType) *EcdsaPublicKey

func NewHmacKey

func NewHmacKey(hashType HashType, tagSize uint32) *HmacKey

func NewHmacKeyData

func NewHmacKeyData(hashType HashType, tagSize uint32) *KeyData

func NewHmacKeyFormat

func NewHmacKeyFormat(hashType HashType, tagSize uint32) *HmacKeyFormat

func NewHmacKeysetManager

func NewHmacKeysetManager() *tink.KeysetManager

func NewSerializedAesGcmKey

func NewSerializedAesGcmKey(keySize uint32) []byte

func NewTestAesGcmKeyset

func NewTestAesGcmKeyset(primaryOutputPrefixType OutputPrefixType) *Keyset

func NewTestHmacKeyset

func NewTestHmacKeyset(tagSize uint32,
	primaryOutputPrefixType OutputPrefixType) *Keyset

func NewTestKeyset

func NewTestKeyset(keyData *KeyData,
	primaryOutputPrefixType OutputPrefixType) *Keyset

Types

type DummyAead

type DummyAead struct{}

DummyAead is a dummy implementation of Aead interface.

func (*DummyAead) Decrypt

func (_ *DummyAead) Decrypt(ciphertext []byte, additionalData []byte) ([]byte, error)

func (*DummyAead) Encrypt

func (_ *DummyAead) Encrypt(plaintext []byte, additionalData []byte) ([]byte, error)

type DummyAeadKeyManager

type DummyAeadKeyManager struct{}

DummyAeadKeyManager is a dummy implementation of the KeyManager interface. It returns DummyAead when GetPrimitive() functions are called.

func (*DummyAeadKeyManager) DoesSupport

func (_ *DummyAeadKeyManager) DoesSupport(typeUrl string) bool

func (*DummyAeadKeyManager) GetKeyType

func (_ *DummyAeadKeyManager) GetKeyType() string

func (*DummyAeadKeyManager) GetPrimitiveFromKey

func (_ *DummyAeadKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)

func (*DummyAeadKeyManager) GetPrimitiveFromSerializedKey

func (_ *DummyAeadKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)

func (*DummyAeadKeyManager) NewKeyData

func (_ *DummyAeadKeyManager) NewKeyData(serializedKeyFormat []byte) (*KeyData, error)

func (*DummyAeadKeyManager) NewKeyFromKeyFormat

func (_ *DummyAeadKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)

func (*DummyAeadKeyManager) NewKeyFromSerializedKeyFormat

func (_ *DummyAeadKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)

type DummyMac

type DummyMac struct {
	Name string
}

DummyMac is a dummy implementation of Mac interface.

func (*DummyMac) ComputeMac

func (h *DummyMac) ComputeMac(data []byte) ([]byte, error)

func (*DummyMac) VerifyMac

func (h *DummyMac) VerifyMac(mac []byte, data []byte) (bool, error)

Jump to

Keyboard shortcuts

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