tink_go_proto

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyData_KeyMaterialType_name = map[int32]string{
	0: "UNKNOWN_KEYMATERIAL",
	1: "SYMMETRIC",
	2: "ASYMMETRIC_PRIVATE",
	3: "ASYMMETRIC_PUBLIC",
	4: "REMOTE",
}
View Source
var KeyData_KeyMaterialType_value = map[string]int32{
	"UNKNOWN_KEYMATERIAL": 0,
	"SYMMETRIC":           1,
	"ASYMMETRIC_PRIVATE":  2,
	"ASYMMETRIC_PUBLIC":   3,
	"REMOTE":              4,
}
View Source
var KeyStatusType_name = map[int32]string{
	0: "UNKNOWN_STATUS",
	1: "ENABLED",
	2: "DISABLED",
	3: "DESTROYED",
}
View Source
var KeyStatusType_value = map[string]int32{
	"UNKNOWN_STATUS": 0,
	"ENABLED":        1,
	"DISABLED":       2,
	"DESTROYED":      3,
}
View Source
var OutputPrefixType_name = map[int32]string{
	0: "UNKNOWN_PREFIX",
	1: "TINK",
	2: "LEGACY",
	3: "RAW",
	4: "CRUNCHY",
}
View Source
var OutputPrefixType_value = map[string]int32{
	"UNKNOWN_PREFIX": 0,
	"TINK":           1,
	"LEGACY":         2,
	"RAW":            3,
	"CRUNCHY":        4,
}

Functions

This section is empty.

Types

type EncryptedKeyset

type EncryptedKeyset struct {
	// Required.
	EncryptedKeyset []byte `protobuf:"bytes,2,opt,name=encrypted_keyset,json=encryptedKeyset,proto3" json:"encrypted_keyset,omitempty"`
	// Optional.
	KeysetInfo           *KeysetInfo `protobuf:"bytes,3,opt,name=keyset_info,json=keysetInfo,proto3" json:"keyset_info,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

Represents a keyset that is encrypted with a master key.

func (*EncryptedKeyset) Descriptor

func (*EncryptedKeyset) Descriptor() ([]byte, []int)

func (*EncryptedKeyset) GetEncryptedKeyset

func (m *EncryptedKeyset) GetEncryptedKeyset() []byte

func (*EncryptedKeyset) GetKeysetInfo

func (m *EncryptedKeyset) GetKeysetInfo() *KeysetInfo

func (*EncryptedKeyset) ProtoMessage

func (*EncryptedKeyset) ProtoMessage()

func (*EncryptedKeyset) Reset

func (m *EncryptedKeyset) Reset()

func (*EncryptedKeyset) String

func (m *EncryptedKeyset) String() string

func (*EncryptedKeyset) XXX_DiscardUnknown added in v1.3.0

func (m *EncryptedKeyset) XXX_DiscardUnknown()

func (*EncryptedKeyset) XXX_Marshal added in v1.3.0

func (m *EncryptedKeyset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EncryptedKeyset) XXX_Merge added in v1.3.0

func (m *EncryptedKeyset) XXX_Merge(src proto.Message)

func (*EncryptedKeyset) XXX_Size added in v1.3.0

func (m *EncryptedKeyset) XXX_Size() int

func (*EncryptedKeyset) XXX_Unmarshal added in v1.3.0

func (m *EncryptedKeyset) XXX_Unmarshal(b []byte) error

type KeyData

type KeyData struct {
	// Required.
	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// Required.
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Required.
	KeyMaterialType      KeyData_KeyMaterialType `` /* 157-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

The actual *Key-proto is wrapped in a KeyData message, which in addition to this serialized proto contains also type_url identifying the definition of *Key-proto (as in KeyFormat-message), and some extra metadata about the type key material.

func (*KeyData) Descriptor

func (*KeyData) Descriptor() ([]byte, []int)

func (*KeyData) GetKeyMaterialType

func (m *KeyData) GetKeyMaterialType() KeyData_KeyMaterialType

func (*KeyData) GetTypeUrl

func (m *KeyData) GetTypeUrl() string

func (*KeyData) GetValue

func (m *KeyData) GetValue() []byte

func (*KeyData) ProtoMessage

func (*KeyData) ProtoMessage()

func (*KeyData) Reset

func (m *KeyData) Reset()

func (*KeyData) String

func (m *KeyData) String() string

func (*KeyData) XXX_DiscardUnknown added in v1.3.0

func (m *KeyData) XXX_DiscardUnknown()

func (*KeyData) XXX_Marshal added in v1.3.0

func (m *KeyData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeyData) XXX_Merge added in v1.3.0

func (m *KeyData) XXX_Merge(src proto.Message)

func (*KeyData) XXX_Size added in v1.3.0

func (m *KeyData) XXX_Size() int

func (*KeyData) XXX_Unmarshal added in v1.3.0

func (m *KeyData) XXX_Unmarshal(b []byte) error

type KeyData_KeyMaterialType

type KeyData_KeyMaterialType int32
const (
	KeyData_UNKNOWN_KEYMATERIAL KeyData_KeyMaterialType = 0
	KeyData_SYMMETRIC           KeyData_KeyMaterialType = 1
	KeyData_ASYMMETRIC_PRIVATE  KeyData_KeyMaterialType = 2
	KeyData_ASYMMETRIC_PUBLIC   KeyData_KeyMaterialType = 3
	KeyData_REMOTE              KeyData_KeyMaterialType = 4
)

func (KeyData_KeyMaterialType) EnumDescriptor

func (KeyData_KeyMaterialType) EnumDescriptor() ([]byte, []int)

func (KeyData_KeyMaterialType) String

func (x KeyData_KeyMaterialType) String() string

type KeyStatusType

type KeyStatusType int32
const (
	KeyStatusType_UNKNOWN_STATUS KeyStatusType = 0
	KeyStatusType_ENABLED        KeyStatusType = 1
	KeyStatusType_DISABLED       KeyStatusType = 2
	KeyStatusType_DESTROYED      KeyStatusType = 3
)

func (KeyStatusType) EnumDescriptor

func (KeyStatusType) EnumDescriptor() ([]byte, []int)

func (KeyStatusType) String

func (x KeyStatusType) String() string

type KeyTemplate

type KeyTemplate struct {
	// Required.
	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// Optional.
	// If missing, it means the key type doesn't require a *KeyFormat proto.
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Optional.
	// If missing, uses OutputPrefixType.TINK.
	OutputPrefixType     OutputPrefixType `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*KeyTemplate) Descriptor

func (*KeyTemplate) Descriptor() ([]byte, []int)

func (*KeyTemplate) GetOutputPrefixType

func (m *KeyTemplate) GetOutputPrefixType() OutputPrefixType

func (*KeyTemplate) GetTypeUrl

func (m *KeyTemplate) GetTypeUrl() string

func (*KeyTemplate) GetValue

func (m *KeyTemplate) GetValue() []byte

func (*KeyTemplate) ProtoMessage

func (*KeyTemplate) ProtoMessage()

func (*KeyTemplate) Reset

func (m *KeyTemplate) Reset()

func (*KeyTemplate) String

func (m *KeyTemplate) String() string

func (*KeyTemplate) XXX_DiscardUnknown added in v1.3.0

func (m *KeyTemplate) XXX_DiscardUnknown()

func (*KeyTemplate) XXX_Marshal added in v1.3.0

func (m *KeyTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeyTemplate) XXX_Merge added in v1.3.0

func (m *KeyTemplate) XXX_Merge(src proto.Message)

func (*KeyTemplate) XXX_Size added in v1.3.0

func (m *KeyTemplate) XXX_Size() int

func (*KeyTemplate) XXX_Unmarshal added in v1.3.0

func (m *KeyTemplate) XXX_Unmarshal(b []byte) error

type Keyset

type Keyset struct {
	// Identifies key used to generate new crypto data (encrypt, sign).
	// Required.
	PrimaryKeyId uint32 `protobuf:"varint,1,opt,name=primary_key_id,json=primaryKeyId,proto3" json:"primary_key_id,omitempty"`
	// Actual keys in the Keyset.
	// Required.
	Key                  []*Keyset_Key `protobuf:"bytes,2,rep,name=key,proto3" json:"key,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

A Tink user works usually not with single keys, but with keysets, to enable key rotation. The keys in a keyset can belong to different implementations/key types, but must all implement the same primitive. Any given keyset (and any given key) can be used for one primitive only.

func (*Keyset) Descriptor

func (*Keyset) Descriptor() ([]byte, []int)

func (*Keyset) GetKey

func (m *Keyset) GetKey() []*Keyset_Key

func (*Keyset) GetPrimaryKeyId

func (m *Keyset) GetPrimaryKeyId() uint32

func (*Keyset) ProtoMessage

func (*Keyset) ProtoMessage()

func (*Keyset) Reset

func (m *Keyset) Reset()

func (*Keyset) String

func (m *Keyset) String() string

func (*Keyset) XXX_DiscardUnknown added in v1.3.0

func (m *Keyset) XXX_DiscardUnknown()

func (*Keyset) XXX_Marshal added in v1.3.0

func (m *Keyset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Keyset) XXX_Merge added in v1.3.0

func (m *Keyset) XXX_Merge(src proto.Message)

func (*Keyset) XXX_Size added in v1.3.0

func (m *Keyset) XXX_Size() int

func (*Keyset) XXX_Unmarshal added in v1.3.0

func (m *Keyset) XXX_Unmarshal(b []byte) error

type KeysetInfo

type KeysetInfo struct {
	// See Keyset.primary_key_id.
	PrimaryKeyId uint32 `protobuf:"varint,1,opt,name=primary_key_id,json=primaryKeyId,proto3" json:"primary_key_id,omitempty"`
	// KeyInfos in the KeysetInfo.
	// Each KeyInfo is corresponding to a Key in the corresponding Keyset.
	KeyInfo              []*KeysetInfo_KeyInfo `protobuf:"bytes,2,rep,name=key_info,json=keyInfo,proto3" json:"key_info,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

Represents a "safe" Keyset that doesn't contain any actual key material, thus can be used for logging or monitoring. Most fields are copied from Keyset.

func (*KeysetInfo) Descriptor

func (*KeysetInfo) Descriptor() ([]byte, []int)

func (*KeysetInfo) GetKeyInfo

func (m *KeysetInfo) GetKeyInfo() []*KeysetInfo_KeyInfo

func (*KeysetInfo) GetPrimaryKeyId

func (m *KeysetInfo) GetPrimaryKeyId() uint32

func (*KeysetInfo) ProtoMessage

func (*KeysetInfo) ProtoMessage()

func (*KeysetInfo) Reset

func (m *KeysetInfo) Reset()

func (*KeysetInfo) String

func (m *KeysetInfo) String() string

func (*KeysetInfo) XXX_DiscardUnknown added in v1.3.0

func (m *KeysetInfo) XXX_DiscardUnknown()

func (*KeysetInfo) XXX_Marshal added in v1.3.0

func (m *KeysetInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeysetInfo) XXX_Merge added in v1.3.0

func (m *KeysetInfo) XXX_Merge(src proto.Message)

func (*KeysetInfo) XXX_Size added in v1.3.0

func (m *KeysetInfo) XXX_Size() int

func (*KeysetInfo) XXX_Unmarshal added in v1.3.0

func (m *KeysetInfo) XXX_Unmarshal(b []byte) error

type KeysetInfo_KeyInfo

type KeysetInfo_KeyInfo struct {
	// the type url of this key,
	// e.g., type.googleapis.com/google.crypto.tink.HmacKey.
	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
	// See Keyset.Key.status.
	Status KeyStatusType `protobuf:"varint,2,opt,name=status,proto3,enum=google.crypto.tink.KeyStatusType" json:"status,omitempty"`
	// See Keyset.Key.key_id.
	KeyId uint32 `protobuf:"varint,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	// See Keyset.Key.output_prefix_type.
	OutputPrefixType     OutputPrefixType `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*KeysetInfo_KeyInfo) Descriptor

func (*KeysetInfo_KeyInfo) Descriptor() ([]byte, []int)

func (*KeysetInfo_KeyInfo) GetKeyId

func (m *KeysetInfo_KeyInfo) GetKeyId() uint32

func (*KeysetInfo_KeyInfo) GetOutputPrefixType

func (m *KeysetInfo_KeyInfo) GetOutputPrefixType() OutputPrefixType

func (*KeysetInfo_KeyInfo) GetStatus

func (m *KeysetInfo_KeyInfo) GetStatus() KeyStatusType

func (*KeysetInfo_KeyInfo) GetTypeUrl

func (m *KeysetInfo_KeyInfo) GetTypeUrl() string

func (*KeysetInfo_KeyInfo) ProtoMessage

func (*KeysetInfo_KeyInfo) ProtoMessage()

func (*KeysetInfo_KeyInfo) Reset

func (m *KeysetInfo_KeyInfo) Reset()

func (*KeysetInfo_KeyInfo) String

func (m *KeysetInfo_KeyInfo) String() string

func (*KeysetInfo_KeyInfo) XXX_DiscardUnknown added in v1.3.0

func (m *KeysetInfo_KeyInfo) XXX_DiscardUnknown()

func (*KeysetInfo_KeyInfo) XXX_Marshal added in v1.3.0

func (m *KeysetInfo_KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KeysetInfo_KeyInfo) XXX_Merge added in v1.3.0

func (m *KeysetInfo_KeyInfo) XXX_Merge(src proto.Message)

func (*KeysetInfo_KeyInfo) XXX_Size added in v1.3.0

func (m *KeysetInfo_KeyInfo) XXX_Size() int

func (*KeysetInfo_KeyInfo) XXX_Unmarshal added in v1.3.0

func (m *KeysetInfo_KeyInfo) XXX_Unmarshal(b []byte) error

type Keyset_Key

type Keyset_Key struct {
	// Contains the actual, instantiation specific key proto.
	// By convention, each key proto contains a version field.
	KeyData *KeyData      `protobuf:"bytes,1,opt,name=key_data,json=keyData,proto3" json:"key_data,omitempty"`
	Status  KeyStatusType `protobuf:"varint,2,opt,name=status,proto3,enum=google.crypto.tink.KeyStatusType" json:"status,omitempty"`
	// Identifies a key within a keyset, is a part of metadata
	// of a ciphertext/signature.
	KeyId uint32 `protobuf:"varint,3,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
	// Determines the prefix of the ciphertexts/signatures produced by this key.
	// This value is copied verbatim from the key template.
	OutputPrefixType     OutputPrefixType `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Keyset_Key) Descriptor

func (*Keyset_Key) Descriptor() ([]byte, []int)

func (*Keyset_Key) GetKeyData

func (m *Keyset_Key) GetKeyData() *KeyData

func (*Keyset_Key) GetKeyId

func (m *Keyset_Key) GetKeyId() uint32

func (*Keyset_Key) GetOutputPrefixType

func (m *Keyset_Key) GetOutputPrefixType() OutputPrefixType

func (*Keyset_Key) GetStatus

func (m *Keyset_Key) GetStatus() KeyStatusType

func (*Keyset_Key) ProtoMessage

func (*Keyset_Key) ProtoMessage()

func (*Keyset_Key) Reset

func (m *Keyset_Key) Reset()

func (*Keyset_Key) String

func (m *Keyset_Key) String() string

func (*Keyset_Key) XXX_DiscardUnknown added in v1.3.0

func (m *Keyset_Key) XXX_DiscardUnknown()

func (*Keyset_Key) XXX_Marshal added in v1.3.0

func (m *Keyset_Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Keyset_Key) XXX_Merge added in v1.3.0

func (m *Keyset_Key) XXX_Merge(src proto.Message)

func (*Keyset_Key) XXX_Size added in v1.3.0

func (m *Keyset_Key) XXX_Size() int

func (*Keyset_Key) XXX_Unmarshal added in v1.3.0

func (m *Keyset_Key) XXX_Unmarshal(b []byte) error

type OutputPrefixType

type OutputPrefixType int32

Tink produces and accepts ciphertexts or signatures that consist of a prefix and a payload. The payload and its format is determined entirely by the primitive, but the prefix has to be one of the following 4 types:

  • Legacy: prefix is 5 bytes, starts with \x00 and followed by a 4-byte key id that is computed from the key material.
  • Crunchy: prefix is 5 bytes, starts with \x00 and followed by a 4-byte key id that is generated randomly.
  • Tink : prefix is 5 bytes, starts with \x01 and followed by 4-byte key id that is generated randomly.
  • Raw : prefix is 0 byte, i.e., empty.
const (
	OutputPrefixType_UNKNOWN_PREFIX OutputPrefixType = 0
	OutputPrefixType_TINK           OutputPrefixType = 1
	OutputPrefixType_LEGACY         OutputPrefixType = 2
	OutputPrefixType_RAW            OutputPrefixType = 3
	// CRUNCHY is like LEGACY, but with two differences:
	//   - Its key id is generated randomly (like TINK)
	//   - Its signature schemes don't append zero to sign messages
	OutputPrefixType_CRUNCHY OutputPrefixType = 4
)

func (OutputPrefixType) EnumDescriptor

func (OutputPrefixType) EnumDescriptor() ([]byte, []int)

func (OutputPrefixType) String

func (x OutputPrefixType) String() string

Jump to

Keyboard shortcuts

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