Documentation ¶
Index ¶
Constants ¶
const ( ConfigPrivKey = "priv_key" ConfigPubKey = "pub_key" ConfigKeyId = "key_id" ConfigKeyPurposes = "key_purposes" )
Variables ¶
This section is empty.
Functions ¶
func TestSigInfo ¶
func TestSigInfo(t *testing.T, privKey ed25519.PrivateKey, msg []byte, opt ...wrapping.Option) *wrapping.SigInfo
TestSigInfo creates a test SigInfo using the provided ed25519 priv key
func WithPrivKey ¶
func WithPrivKey(k ed25519.PrivateKey) wrapping.Option
WithPrivKey provides a common way to pass in a private key. This local option will override a ConfigMap provide option.
Types ¶
type OptionFunc ¶
type OptionFunc func(*options) error
OptionFunc holds a function with local options
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer provides an ed25519 implementation for the wrapping.Signer interface
func NewSigner ¶
NewSigner creates a new Signer. Supported options: WithKeyId, WithKeyPurposes, WithPrivKey, WithConfigMap
Note: options order of precedence is: local options, WithConfigMap provided options and finally wrapping options.
func (*Signer) SetConfig ¶
func (s *Signer) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
SetConfig sets the fields on the Signer
Supported options: wrapping.WithKeyId, wrapping.WithKeyPurposes, wrapping.WithConfigMap and the local WithPrivKey
Note: options order of precedence is: local options, WithConfigMap provided options and finally wrapping options.
wrapping.WithConfigMap supports a ConfigPrivKey to set the Signer priv key along with ConfigKeyId, and ConfigKeyPurposes. ConfigKeyPurposes are a comma delimited list of wrapping.KeyPurpose_name values (for example: "Sign, Verify")
The values in WithConfigMap can also be set via the package's native local options.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier provides and ed25519 implementation for the wrapping.Verifier interface
func NewVerifier ¶
NewVerifier creates a new verifier. Supported options: WithKeyId, WithKeyPurposes, WithPubKey, WithConfigMap
Note: options order of precedence is: local options, WithConfigMap provided options and finally wrapping options.
func (*Verifier) SetConfig ¶
func (s *Verifier) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
SetConfig sets the fields on the Verifier
Supported options: wrapping.WithKeyId, wrapping.WithKeyPurposes, wrapping.WithConfigMap and the local WithPubKey
Note: options order of precedence is: local options, WithConfigMap provided options and finally wrapping options.
wrapping.WithConfigMap supports a ConfigPubKey to set the Verifier pub key. along with ConfigKeyId, and ConfigKeyPurposes. ConfigKeyPurposes are a comma delimited list of wrapping.KeyPurpose_name values (for example: "Sign, Verify")
The values in WithConfigMap can also be set via the package's native local options.