Documentation ¶
Overview ¶
Package tink_proto is a generated protocol buffer package.
It is generated from these files:
tink.proto
It has these top-level messages:
KeyTemplate KeyData Keyset KeysetInfo EncryptedKeyset
Index ¶
- Variables
- type EncryptedKeyset
- type KeyData
- type KeyData_KeyMaterialType
- type KeyStatusType
- type KeyTemplate
- type Keyset
- type KeysetInfo
- type KeysetInfo_KeyInfo
- func (*KeysetInfo_KeyInfo) Descriptor() ([]byte, []int)
- func (m *KeysetInfo_KeyInfo) GetKeyId() uint32
- func (m *KeysetInfo_KeyInfo) GetOutputPrefixType() OutputPrefixType
- func (m *KeysetInfo_KeyInfo) GetStatus() KeyStatusType
- func (m *KeysetInfo_KeyInfo) GetTypeUrl() string
- func (*KeysetInfo_KeyInfo) ProtoMessage()
- func (m *KeysetInfo_KeyInfo) Reset()
- func (m *KeysetInfo_KeyInfo) String() string
- type Keyset_Key
- func (*Keyset_Key) Descriptor() ([]byte, []int)
- func (m *Keyset_Key) GetKeyData() *KeyData
- func (m *Keyset_Key) GetKeyId() uint32
- func (m *Keyset_Key) GetOutputPrefixType() OutputPrefixType
- func (m *Keyset_Key) GetStatus() KeyStatusType
- func (*Keyset_Key) ProtoMessage()
- func (m *Keyset_Key) Reset()
- func (m *Keyset_Key) String() string
- type OutputPrefixType
Constants ¶
This section is empty.
Variables ¶
var KeyData_KeyMaterialType_name = map[int32]string{
0: "UNKNOWN_KEYMATERIAL",
1: "SYMMETRIC",
2: "ASYMMETRIC_PRIVATE",
3: "ASYMMETRIC_PUBLIC",
4: "REMOTE",
}
var KeyData_KeyMaterialType_value = map[string]int32{
"UNKNOWN_KEYMATERIAL": 0,
"SYMMETRIC": 1,
"ASYMMETRIC_PRIVATE": 2,
"ASYMMETRIC_PUBLIC": 3,
"REMOTE": 4,
}
var KeyStatusType_name = map[int32]string{
0: "UNKNOWN_STATUS",
1: "ENABLED",
2: "DISABLED",
3: "DESTROYED",
}
var KeyStatusType_value = map[string]int32{
"UNKNOWN_STATUS": 0,
"ENABLED": 1,
"DISABLED": 2,
"DESTROYED": 3,
}
var OutputPrefixType_name = map[int32]string{
0: "UNKNOWN_PREFIX",
1: "TINK",
2: "LEGACY",
3: "RAW",
4: "CRUNCHY",
}
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" json:"keyset_info,omitempty"` }
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
type KeyData ¶
type KeyData struct { // Required. TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"` // Required. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // Required. KeyMaterialType KeyData_KeyMaterialType `` /* 150-byte string literal not displayed */ }
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) GetKeyMaterialType ¶
func (m *KeyData) GetKeyMaterialType() KeyData_KeyMaterialType
func (*KeyData) GetTypeUrl ¶
func (*KeyData) ProtoMessage ¶
func (*KeyData) ProtoMessage()
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" 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 `` /* 146-byte string literal not displayed */ }
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
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" json:"primary_key_id,omitempty"` // Actual keys in the Keyset. // Required. Key []*Keyset_Key `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"` }
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) GetKey ¶
func (m *Keyset) GetKey() []*Keyset_Key
func (*Keyset) GetPrimaryKeyId ¶
func (*Keyset) ProtoMessage ¶
func (*Keyset) ProtoMessage()
type KeysetInfo ¶
type KeysetInfo struct { // See Keyset.primary_key_id. PrimaryKeyId uint32 `protobuf:"varint,1,opt,name=primary_key_id,json=primaryKeyId" 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" json:"key_info,omitempty"` }
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
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" json:"type_url,omitempty"` // See Keyset.Key.status. Status KeyStatusType `protobuf:"varint,2,opt,name=status,enum=google.crypto.tink.KeyStatusType" json:"status,omitempty"` // See Keyset.Key.key_id. KeyId uint32 `protobuf:"varint,3,opt,name=key_id,json=keyId" json:"key_id,omitempty"` // See Keyset.Key.output_prefix_type. OutputPrefixType OutputPrefixType `` /* 146-byte string literal not displayed */ }
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
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" json:"key_data,omitempty"` Status KeyStatusType `protobuf:"varint,2,opt,name=status,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" 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 `` /* 146-byte string literal not displayed */ }
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
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