// Create signs data with the secret.
Create signs data with the secret.
// Create signs data with the secret .
func (a *signatureHashAlgorithm) Create(secret httpsig.Secret, data []byte) ([]byte, error) {
	logger.Infof("Public key ID [%s], KMS key ID [%s]", secret.KeyID, a.KeyID)
	kh, err := a.KMS.Get(a.KeyID)
	if err != nil {
		return nil, fmt.Errorf("get key handle: %w", err)
	}
	logger.Infof("Got key handle for key ID [%s]: %+v. Signing ...", a.KeyID, kh)
	sig, err := a.Crypto.Sign(data, kh)
	if err != nil {
		return nil, fmt.Errorf("sign data: %w", err)
	}
	logger.Infof("... successfully signed data with KeyID from KMS [%s]", a.KeyID)
	return sig, nil
}
func ( a * signatureHashAlgorithm ) Create ( secret httpsig . Secret , data [ ] byte ) ( [ ] byte , error ) { logger . Infof ( " " , secret . KeyID , a . KeyID ) kh , err := a . KMS . Get ( a . KeyID ) if err != nil { return nil , fmt . Errorf ( " " , err ) } logger . Infof ( " " , a . KeyID , kh ) sig , err := a . Crypto . Sign ( data , kh ) if err != nil { return nil , fmt . Errorf ( " " , err ) } logger . Infof ( " " , a . KeyID ) return sig , nil }
Create signs data with the secret.
Create signs data with the secret .