github.com/blend/go-sdk@v1.20220411.3/vault/transit_client.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package vault
     9  
    10  import (
    11  	"context"
    12  )
    13  
    14  // TransitClient is an interface for an encryption-as-a-service client
    15  type TransitClient interface {
    16  	CreateTransitKey(ctx context.Context, key string, options ...CreateTransitKeyOption) error
    17  	ConfigureTransitKey(ctx context.Context, key string, options ...UpdateTransitKeyOption) error
    18  	ReadTransitKey(ctx context.Context, key string) (map[string]interface{}, error)
    19  	DeleteTransitKey(ctx context.Context, key string) error
    20  
    21  	Encrypt(ctx context.Context, key string, context, data []byte) (string, error)
    22  	Decrypt(ctx context.Context, key string, context []byte, ciphertext string) ([]byte, error)
    23  
    24  	TransitHMAC(ctx context.Context, key string, input []byte) ([]byte, error)
    25  
    26  	BatchEncrypt(ctx context.Context, key string, batchInput BatchTransitInput) ([]string, error)
    27  	BatchDecrypt(ctx context.Context, key string, batchInput BatchTransitInput) ([][]byte, error)
    28  }