Documentation
¶
Overview ¶
Package aead provides implementations of the Aead primitive.
Index ¶
- Constants
- func Aes128GcmKeyTemplate() *tinkpb.KeyTemplate
- func Aes256GcmKeyTemplate() *tinkpb.KeyTemplate
- func Config() *config
- func Factory() *factory
- func NewAesGcmKey(version uint32, keyValue []byte) *gcmpb.AesGcmKey
- func NewAesGcmKeyFormat(keySize uint32) *gcmpb.AesGcmKeyFormat
- type AesGcmKeyManager
- func (km *AesGcmKeyManager) DoesSupport(typeURL string) bool
- func (km *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 ( // AesGcmKeyVersion is the maxmimal version of keys that this key manager supports. AesGcmKeyVersion = 0 // AesGcmTypeURL is the url that this key manager supports. AesGcmTypeURL = "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
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 NewAesGcmKey ¶ added in v1.1.0
NewAesGcmKey returns a new AesGcmKey.
func NewAesGcmKeyFormat ¶ added in v1.1.0
func NewAesGcmKeyFormat(keySize uint32) *gcmpb.AesGcmKeyFormat
NewAesGcmKeyFormat returns a new AesGcmKeyFormat.
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 (km *AesGcmKeyManager) DoesSupport(typeURL string) bool
DoesSupport indicates if this key manager supports the given key type.
func (*AesGcmKeyManager) GetKeyType ¶
func (km *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.