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.
//////////////////////////////////////////////////////////////////////////////
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 Config() *config
- func Factory() *factory
- func HmacSha256Tag128KeyTemplate() *tinkpb.KeyTemplate
- func HmacSha256Tag256KeyTemplate() *tinkpb.KeyTemplate
- type HmacKeyManager
- func (_ *HmacKeyManager) DoesSupport(typeUrl string) bool
- func (_ *HmacKeyManager) GetKeyType() string
- func (km *HmacKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
- func (km *HmacKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
- func (km *HmacKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
- func (km *HmacKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)
- func (km *HmacKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
Constants ¶
const ( // Type url that this manager supports. HMAC_TYPE_URL = "type.googleapis.com/google.crypto.tink.HmacKey" // Current version of this key manager. // Keys with version equal or smaller are supported. HMAC_KEY_VERSION = uint32(0) )
Variables ¶
This section is empty.
Functions ¶
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.
func HmacSha256Tag128KeyTemplate ¶
func HmacSha256Tag128KeyTemplate() *tinkpb.KeyTemplate
HmacSha256Tag128KeyTemplate is a KeyTemplate for HmacKey with the following parameters:
- Key size: 32 bytes
- Tag size: 16 bytes
- Hash function: SHA256
func HmacSha256Tag256KeyTemplate ¶
func HmacSha256Tag256KeyTemplate() *tinkpb.KeyTemplate
HmacSha256Tag256KeyTemplate is a KeyTemplate for HmacKey with the following parameters:
- Key size: 32 bytes
- Tag size: 32 bytes
- Hash function: SHA256
Types ¶
type HmacKeyManager ¶
type HmacKeyManager struct{}
HmacKeyManager generates new HmacKeys and produces new instances of Hmac.
func NewHmacKeyManager ¶
func NewHmacKeyManager() *HmacKeyManager
NewHmacKeyManager returns a new HmacKeyManager.
func (*HmacKeyManager) DoesSupport ¶
func (_ *HmacKeyManager) DoesSupport(typeUrl string) bool
DoesSupport checks whether this KeyManager supports the given key type.
func (*HmacKeyManager) GetKeyType ¶
func (_ *HmacKeyManager) GetKeyType() string
GetKeyType returns the type URL of keys managed by this KeyManager.
func (*HmacKeyManager) GetPrimitiveFromKey ¶
func (km *HmacKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
GetPrimitiveFromKey constructs a HMAC instance for the given HmacKey.
func (*HmacKeyManager) GetPrimitiveFromSerializedKey ¶
func (km *HmacKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
GetPrimitiveFromSerializedKey constructs a Hmac instance for the given serialized HmacKey.
func (*HmacKeyManager) NewKeyData ¶
func (km *HmacKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
NewKeyData generates a new KeyData according to specification in the given serialized HmacKeyFormat. This should be used solely by the key management API.
func (*HmacKeyManager) NewKeyFromKeyFormat ¶
NewKeyFromKeyFormat generates a new HmacKey according to specification in the given HmacKeyFormat.
func (*HmacKeyManager) NewKeyFromSerializedKeyFormat ¶
func (km *HmacKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
NewKeyFromSerializedKeyFormat generates a new HmacKey according to specification in the given serialized HmacKeyFormat.