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.
//////////////////////////////////////////////////////////////////////////////
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 EcdsaP256KeyTemplate() *tinkpb.KeyTemplate
- func EcdsaP384KeyTemplate() *tinkpb.KeyTemplate
- func EcdsaP521KeyTemplate() *tinkpb.KeyTemplate
- func PublicKeySignConfig() *publicKeySignConfig
- func PublicKeySignFactory() *publicKeySignFactory
- func PublicKeyVerifyConfig() *publicKeyVerifyConfig
- func PublicKeyVerifyFactory() *publicKeyVerifyFactory
- type EcdsaSignKeyManager
- func (_ *EcdsaSignKeyManager) DoesSupport(typeUrl string) bool
- func (_ *EcdsaSignKeyManager) GetKeyType() string
- func (km *EcdsaSignKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
- func (km *EcdsaSignKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
- func (km *EcdsaSignKeyManager) GetPublicKeyData(serializedPrivKey []byte) (*tinkpb.KeyData, error)
- func (km *EcdsaSignKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
- func (km *EcdsaSignKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)
- func (km *EcdsaSignKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
- type EcdsaVerifyKeyManager
- func (_ *EcdsaVerifyKeyManager) DoesSupport(typeUrl string) bool
- func (_ *EcdsaVerifyKeyManager) GetKeyType() string
- func (km *EcdsaVerifyKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
- func (km *EcdsaVerifyKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
- func (km *EcdsaVerifyKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
- func (km *EcdsaVerifyKeyManager) NewKeyFromKeyFormat(m proto.Message) (proto.Message, error)
- func (km *EcdsaVerifyKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
Constants ¶
const ( // Supported version ECDSA_SIGN_KEY_VERSION = 0 // Supported type url ECDSA_SIGN_TYPE_URL = "type.googleapis.com/google.crypto.tink.EcdsaPrivateKey" )
const ( // Supported version ECDSA_VERIFY_KEY_VERSION = 0 // Supported type url ECDSA_VERIFY_TYPE_URL = "type.googleapis.com/google.crypto.tink.EcdsaPublicKey" )
Variables ¶
This section is empty.
Functions ¶
func EcdsaP256KeyTemplate ¶
func EcdsaP256KeyTemplate() *tinkpb.KeyTemplate
EcdsaP256KeyTemplate is a KeyTemplate of EcdsaPrivateKey with the following parameters:
- Hash function: SHA256
- Curve: NIST P-256
- Signature encoding: DER
func EcdsaP384KeyTemplate ¶
func EcdsaP384KeyTemplate() *tinkpb.KeyTemplate
EcdsaP384KeyTemplate is a KeyTemplate of EcdsaPrivateKey with the following parameters:
- Hash function: SHA512
- Curve: NIST P-384
- Signature encoding: DER
func EcdsaP521KeyTemplate ¶
func EcdsaP521KeyTemplate() *tinkpb.KeyTemplate
EcdsaP521KeyTemplate is a KeyTemplate of EcdsaPrivateKey with the following parameters:
- Hash function: SHA512
- Curve: NIST P-521
- Signature encoding: DER
func PublicKeySignConfig ¶
func PublicKeySignConfig() *publicKeySignConfig
PublicKeySignConfig creates an instance of publicKeySignConfig if there isn't and returns the instance.
func PublicKeySignFactory ¶
func PublicKeySignFactory() *publicKeySignFactory
publicKeySignFactory creates an instance of publicKeySignFactory if there isn't and returns the instance.
func PublicKeyVerifyConfig ¶
func PublicKeyVerifyConfig() *publicKeyVerifyConfig
PublicKeyVerifyConfig creates an instance of publicKeyVerifyConfig if there isn't and returns the instance.
func PublicKeyVerifyFactory ¶
func PublicKeyVerifyFactory() *publicKeyVerifyFactory
PublicKeyVerifyFactory creates an instance of publicKeyVerifyFactory if there isn't and returns the instance.
Types ¶
type EcdsaSignKeyManager ¶
type EcdsaSignKeyManager struct{}
EcdsaSignKeyManager is an implementation of KeyManager interface. It generates new EcdsaPrivateKeys and produces new instances of EcdsaSign subtle.
func NewEcdsaSignKeyManager ¶
func NewEcdsaSignKeyManager() *EcdsaSignKeyManager
NewEcdsaSignKeyManager creates a new EcdsaSignKeyManager.
func (*EcdsaSignKeyManager) DoesSupport ¶
func (_ *EcdsaSignKeyManager) DoesSupport(typeUrl string) bool
DoesSupport indicates if this key manager supports the given key type.
func (*EcdsaSignKeyManager) GetKeyType ¶
func (_ *EcdsaSignKeyManager) GetKeyType() string
GetKeyType returns the key type of keys managed by this key manager.
func (*EcdsaSignKeyManager) GetPrimitiveFromKey ¶
func (km *EcdsaSignKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
GetPrimitiveFromKey creates an EcdsaSign subtle for the given EcdsaPrivateKey proto.
func (*EcdsaSignKeyManager) GetPrimitiveFromSerializedKey ¶
func (km *EcdsaSignKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
GetPrimitiveFromSerializedKey creates an EcdsaSign subtle for the given serialized EcdsaPrivateKey proto.
func (*EcdsaSignKeyManager) GetPublicKeyData ¶
func (km *EcdsaSignKeyManager) GetPublicKeyData(serializedPrivKey []byte) (*tinkpb.KeyData, error)
GetPublicKeyData extracts the public key data from the private key.
func (*EcdsaSignKeyManager) NewKeyData ¶
func (km *EcdsaSignKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
NewKeyData creates a new KeyData according to specification in the given serialized EcdsaKeyFormat. It should be used solely by the key management API.
func (*EcdsaSignKeyManager) NewKeyFromKeyFormat ¶
NewKeyFromKeyFormat creates a new key according to specification in the given EcdsaKeyFormat.
func (*EcdsaSignKeyManager) NewKeyFromSerializedKeyFormat ¶
func (km *EcdsaSignKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
NewKeyFromSerializedKeyFormat creates a new EcdsaPrivateKey according to specification the given serialized EcdsaKeyFormat.
type EcdsaVerifyKeyManager ¶
type EcdsaVerifyKeyManager struct{}
EcdsaVerifyKeyManager is an implementation of KeyManager interface. It doesn't support key generation.
func NewEcdsaVerifyKeyManager ¶
func NewEcdsaVerifyKeyManager() *EcdsaVerifyKeyManager
NewEcdsaVerifyKeyManager creates a new EcdsaVerifyKeyManager.
func (*EcdsaVerifyKeyManager) DoesSupport ¶
func (_ *EcdsaVerifyKeyManager) DoesSupport(typeUrl string) bool
DoesSupport indicates if this key manager supports the given key type.
func (*EcdsaVerifyKeyManager) GetKeyType ¶
func (_ *EcdsaVerifyKeyManager) GetKeyType() string
GetKeyType returns the key type of keys managed by this key manager.
func (*EcdsaVerifyKeyManager) GetPrimitiveFromKey ¶
func (km *EcdsaVerifyKeyManager) GetPrimitiveFromKey(m proto.Message) (interface{}, error)
GetPrimitiveFromKey creates an EcdsaVerify subtle for the given EcdsaPublicKey proto.
func (*EcdsaVerifyKeyManager) GetPrimitiveFromSerializedKey ¶
func (km *EcdsaVerifyKeyManager) GetPrimitiveFromSerializedKey(serializedKey []byte) (interface{}, error)
GetPrimitiveFromSerializedKey creates an EcdsaVerify subtle for the given serialized EcdsaPublicKey proto.
func (*EcdsaVerifyKeyManager) NewKeyData ¶
func (km *EcdsaVerifyKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)
NewKeyData creates a new KeyData according to specification in the given serialized EcdsaKeyFormat. It should be used solely by the key management API.
func (*EcdsaVerifyKeyManager) NewKeyFromKeyFormat ¶
NewKeyFromKeyFormat is not implemented
func (*EcdsaVerifyKeyManager) NewKeyFromSerializedKeyFormat ¶
func (km *EcdsaVerifyKeyManager) NewKeyFromSerializedKeyFormat(serializedKeyFormat []byte) (proto.Message, error)
NewKeyFromSerializedKeyFormat is not implemented