Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidKeyType = errors.New("invalid key type") ErrInvalidKeyFormat = errors.New("invalid key format") ErrAlgorithmNotSupported = errors.New("key's algorithm is not supported") ErrInvalidAlgorithm = errors.New("key's algorithm is missing or invalid") ErrKeyMissing = errors.New("key does not contain a private key") ErrFailedToParseKey = errors.New("failed to parse key") )
Functions ¶
func DecodeECDSA ¶
func DecodeECDSA(ecPem string) (*ecdsa.PrivateKey, error)
DecodeECDSA decodes EC PEM block and returns a non-nil err on failure.
func DecodeKey ¶
func DecodeKey(algorithm entity.Algorithm, encodedKey string) (crypto.PrivateKey, entity.KeyEncodeFunc, error)
DecodeKey decodes provided key with specified algorithm and returns it along with a callback that should be used to encode the key to proto message format. If decode func for specified algorithm is not found it returns an ErrAlgorithmNotSupported. If the algorithm is not recognized it returns an ErrInvalidAlgorithm.
Types ¶
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
func Make ¶
func Make(ctx context.Context, host, port, token string, config Config, broker event.Broker, tracer trace.Tracer, logger logging.Logger) (Vault, error)
Make takes in a Token used to connect to Vault and returns a DB instance or a non nil error.
If config.KeyRefreshInterval is greater than 0, Vault starts to periodically purge the vault and write a new set of keys. Vault stops refreshing keyset when provided context is cancelled.
Click to show internal directories.
Click to hide internal directories.