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
- func Aes128GcmKeyTemplate() *tinkpb.KeyTemplate
- func Aes256GcmKeyTemplate() *tinkpb.KeyTemplate
- func Config() *config
- func Factory() *factory
- type AesGcmKeyManager
- func (_ *AesGcmKeyManager) DoesSupport(typeUrl string) bool
- func (_ *AesGcmKeyManager) GetKeyType() string
- func (km *AesGcmKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
- func (km *AesGcmKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
- func (km *AesGcmKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
- func (km *AesGcmKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)
- func (km *AesGcmKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
Constants ¶
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
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 ¶
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.