You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/event/signer.go

21 lines
608 B

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package event
import (
"context"
"github.com/hashicorp/boundary/internal/libs/crypto"
wrapping "github.com/hashicorp/go-kms-wrapping/v2"
)
type signer func(context.Context, []byte) (string, error)
func newSigner(_ context.Context, w wrapping.Wrapper, info, salt []byte) (signer, error) {
const op = "event.hmacHclogSigner"
return func(requestCtx context.Context, data []byte) (string, error) {
return crypto.HmacSha256(requestCtx, data, w, info, salt, crypto.WithPrefix("hmac-sha256:"), crypto.WithBase64Encoding())
}, nil
}