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.
//////////////////////////////////////////////////////////////////////////////
Index ¶
- func GetCurveName(curve EllipticCurveType) string
- func GetEcdsaParamNames(params *EcdsaParams) (string, string, string)
- func GetEncodingName(encoding EcdsaSignatureEncoding) string
- func GetHashName(hashType HashType) string
- func GetKeyInfo(key *tinkpb.Keyset_Key) (*tinkpb.KeysetInfo_KeyInfo, error)
- func GetKeysetInfo(keyset *tinkpb.Keyset) (*tinkpb.KeysetInfo, error)
- func NewAesGcmKey(version uint32, keyValue []byte) *AesGcmKey
- func NewAesGcmKeyFormat(keySize uint32) *AesGcmKeyFormat
- func NewEcdsaKeyFormat(params *EcdsaParams) *EcdsaKeyFormat
- func NewEcdsaParams(hashType HashType, curve EllipticCurveType, encoding EcdsaSignatureEncoding) *EcdsaParams
- func NewEcdsaPrivateKey(version uint32, publicKey *EcdsaPublicKey, keyValue []byte) *EcdsaPrivateKey
- func NewEcdsaPublicKey(version uint32, params *EcdsaParams, x []byte, y []byte) *EcdsaPublicKey
- func NewEncryptedKeyset(encryptedKeySet []byte, info *KeysetInfo) *EncryptedKeyset
- func NewHmacKey(params *HmacParams, version uint32, keyValue []byte) *HmacKey
- func NewHmacKeyFormat(params *HmacParams, keySize uint32) *HmacKeyFormat
- func NewHmacParams(hashType HashType, tagSize uint32) *HmacParams
- func NewKey(keyData *KeyData, status KeyStatusType, keyId uint32, ...) *Keyset_Key
- func NewKeyData(typeUrl string, value []byte, materialType KeyData_KeyMaterialType) *KeyData
- func NewKeyset(primaryKeyId uint32, keys []*Keyset_Key) *Keyset
- func ValidateKey(key *tinkpb.Keyset_Key) error
- func ValidateKeyset(keyset *tinkpb.Keyset) error
- func ValidateVersion(version uint32, maxExpected uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurveName ¶
func GetCurveName(curve EllipticCurveType) string
func GetEcdsaParamNames ¶
GetEcdsaParamNames returns the string representations of each parameter in the given EcdsaParams
func GetEncodingName ¶
func GetEncodingName(encoding EcdsaSignatureEncoding) string
func GetHashName ¶
func GetHashName(hashType HashType) string
utilities for converting proto types to strings
func GetKeyInfo ¶
func GetKeyInfo(key *tinkpb.Keyset_Key) (*tinkpb.KeysetInfo_KeyInfo, error)
*
- @return a KeyInfo-proto from a {@code key} protobuf.
func GetKeysetInfo ¶
func GetKeysetInfo(keyset *tinkpb.Keyset) (*tinkpb.KeysetInfo, error)
*
- @return a tinkpb.KeysetInfo-proto from a {@code keyset} protobuf.
func NewAesGcmKey ¶
Utilities for AesGcm protos
func NewAesGcmKeyFormat ¶
func NewAesGcmKeyFormat(keySize uint32) *AesGcmKeyFormat
func NewEcdsaKeyFormat ¶
func NewEcdsaKeyFormat(params *EcdsaParams) *EcdsaKeyFormat
func NewEcdsaParams ¶
func NewEcdsaParams(hashType HashType, curve EllipticCurveType, encoding EcdsaSignatureEncoding) *EcdsaParams
func NewEcdsaPrivateKey ¶
func NewEcdsaPrivateKey(version uint32, publicKey *EcdsaPublicKey, keyValue []byte) *EcdsaPrivateKey
Utilities for Ecdsa protos
func NewEcdsaPublicKey ¶
func NewEncryptedKeyset ¶
func NewEncryptedKeyset(encryptedKeySet []byte, info *KeysetInfo) *EncryptedKeyset
func NewHmacKey ¶
func NewHmacKeyFormat ¶
func NewHmacKeyFormat(params *HmacParams, keySize uint32) *HmacKeyFormat
func NewHmacParams ¶
func NewHmacParams(hashType HashType, tagSize uint32) *HmacParams
Utilities for Hmac Protos
func NewKey ¶
func NewKey(keyData *KeyData, status KeyStatusType, keyId uint32, prefixType OutputPrefixType) *Keyset_Key
func NewKeyData ¶
Utilities for Key Protos
func ValidateKey ¶
func ValidateKey(key *tinkpb.Keyset_Key) error
*
- Validates the given key.
- Returns nil if it is valid; an error otherwise
func ValidateKeyset ¶
*
- Validates the given key set.
- Returns nil if it is valid; an error otherwise.
TODO(thaidn): use TypeLiteral to ensure that all keys are of the same primitive.
func ValidateVersion ¶
ValidateVersion checks whether the given version is valid. The version is valid only if it is the range [0..maxExpected]
Types ¶
This section is empty.