Documentation ¶
Index ¶
- Variables
- func HmacSha256(ctx context.Context, data []byte, cipher wrapping.Wrapper, salt, info []byte, ...) (string, error)
- func HmacSha256WithPrk(ctx context.Context, data, prk []byte, opt ...Option) (string, error)
- func NewDerivedReader(ctx context.Context, wrapper wrapping.Wrapper, lenLimit int64, ...) (*io.LimitedReader, error)
- func TestWrapper(t testing.TB) wrapping.Wrapper
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidParameter = errors.New("Invalid parameter")
Functions ¶
func HmacSha256 ¶
func HmacSha256(ctx context.Context, data []byte, cipher wrapping.Wrapper, salt, info []byte, opt ...Option) (string, error)
HmacSha256 the provided data. Supports WithPrefix, WithEd25519 and WithPrk options. WithEd25519 is a "legacy" way to complete this operation and should not be used in new operations unless backward compatibility is needed. The WithPrefix option will prepend the prefix to the hmac-sha256 value.
func HmacSha256WithPrk ¶
HmacSha256WithPrk will HmacSha256 using the provided prk. See HmacSha256 for options supported.
func NewDerivedReader ¶
func NewDerivedReader(ctx context.Context, wrapper wrapping.Wrapper, lenLimit int64, salt, info []byte) (*io.LimitedReader, error)
DerivedReader returns a reader from which keys can be read, using the given wrapper, reader length limit, salt and context info. Salt and info can be nil.
Example:
reader, _ := NewDerivedReader(wrapper, userId, jobId) key := ed25519.GenerateKey(reader)
Types ¶
type Option ¶
type Option func(*options) error
Option - how Options are passed as arguments.
func WithBase58Encoding ¶
func WithBase58Encoding() Option
WithBase58Encoding allows an optional request to base58 encode the data returned
func WithBase64Encoding ¶
func WithBase64Encoding() Option
WithBase64Encoding allows an optional request to base64 encode the data returned
func WithEd25519 ¶
func WithEd25519() Option
WithEd25519 allows an optional request to use ed25519 during the operation
func WithPrefix ¶
WithPrefix allows an optional prefix to be specified for the data returned