package keys
import "github.com/google/trillian/crypto/keys"
Package keys provides access to public and private keys for signing and verification of signatures.
Index ¶
- func NewSigner(ctx context.Context, keyProto proto.Message) (crypto.Signer, error)
- func RegisterHandler(keyProto proto.Message, handler ProtoHandler)
- type ProtoHandler
Functions ¶
func NewSigner ¶
NewSigner uses a registered ProtoHandler (see RegisterHandler()) to convert a protobuf message into a crypto.Signer. If there is no ProtoHandler registered for this type of protobuf message, an error will be returned.
func RegisterHandler ¶
func RegisterHandler(keyProto proto.Message, handler ProtoHandler)
RegisterHandler enables transformation of protobuf messages of the same type as keyProto into crypto.Signer by invoking the provided handler. The keyProto need only be an empty example of the type of protobuf message that the handler can process - only its type is examined. If a handler for this type of protobuf message has already been added, it will be replaced.
Types ¶
type ProtoHandler ¶
ProtoHandler uses the information in a protobuf message to obtain a crypto.Signer. For example, the protobuf message may contain a key or identify where a key can be found.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
crypto/keys/der | Package der contains functions for marshaling and unmarshaling keys in DER format. |
crypto/keys/pem | Package pem contains functions for marshaling and unmarshaling keys in PEM format. |
crypto/keys/pkcs11 | Package pkcs11 provides access to private keys using a PKCS#11 interface. |
crypto/keys/testonly | Package testonly contains code and data that should only be used by tests. |
- Version
- v1.7.1 (latest)
- Published
- Jan 9, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 5 days ago –
Tools for package owners.