Versions in this module Expand all Collapse all v0 v0.4.1 May 12, 2020 Changes in this version + const AllowedNetwork + const DefaultBaseURL + const DefaultTokenURL + const DualAuthDelete + const VerboseAll + const VerboseAllNoRedact + const VerboseBodyOnly + const VerboseFailOnly + const VerboseNone + var RetryMax = 4 + var RetryWaitMax = 30 * time.Second + func DefaultTransport() http.RoundTripper + func EncryptKey(key, pubkey string) (string, error) + func EncryptNonce(key, value, iv string) (string, string, error) + func NewContextWithAuth(parent context.Context, auth string) context.Context + type API = Client + type Attributes struct + AllowedNetwork string + type CallOpt interface + type Client struct + Config ClientConfig + Dump Dump + HttpClient http.Client + Logger Logger + URL *url.URL + func New(config ClientConfig, transport http.RoundTripper) (*Client, error) + func NewWithLogger(config ClientConfig, transport http.RoundTripper, logger Logger) (*Client, error) + func (c *Client) CreateImportToken(ctx context.Context, expiration, maxAllowedRetrievals int) (*ImportTokenMetadata, error) + func (c *Client) CreateImportedKey(ctx context.Context, name string, expiration *time.Time, ...) (*Key, error) + func (c *Client) CreateImportedRootKey(ctx context.Context, name string, expiration *time.Time, ...) (*Key, error) + func (c *Client) CreateImportedStandardKey(ctx context.Context, name string, expiration *time.Time, payload string) (*Key, error) + func (c *Client) CreateKey(ctx context.Context, name string, expiration *time.Time, extractable bool) (*Key, error) + func (c *Client) CreateRootKey(ctx context.Context, name string, expiration *time.Time) (*Key, error) + func (c *Client) CreateStandardKey(ctx context.Context, name string, expiration *time.Time) (*Key, error) + func (c *Client) DeleteKey(ctx context.Context, id string, prefer PreferReturn, callOpts ...CallOpt) (*Key, error) + func (c *Client) GetImportTokenTransportKey(ctx context.Context) (*ImportTokenKeyResponse, error) + func (c *Client) GetInstancePolicies(ctx context.Context) ([]InstancePolicy, error) + func (c *Client) GetKey(ctx context.Context, id string) (*Key, error) + func (c *Client) GetKeys(ctx context.Context, limit int, offset int) (*Keys, error) + func (c *Client) GetPolicy(ctx context.Context, id string) (*Policy, error) + func (c *Client) Rotate(ctx context.Context, id, payload string) error + func (c *Client) SetInstancePolicies(ctx context.Context, enable bool, networkType, setType string) error + func (c *Client) SetPolicy(ctx context.Context, id string, prefer PreferReturn, rotationInterval int) (*Policy, error) + func (c *Client) Unwrap(ctx context.Context, id string, cipherText []byte, ...) ([]byte, error) + func (c *Client) UnwrapV2(ctx context.Context, id string, cipherText []byte, ...) ([]byte, []byte, error) + func (c *Client) Wrap(ctx context.Context, id string, plainText []byte, additionalAuthData *[]string) ([]byte, error) + func (c *Client) WrapCreateDEK(ctx context.Context, id string, additionalAuthData *[]string) ([]byte, []byte, error) + type ClientConfig struct + APIKey string + Authorization string + BaseURL string + InstanceID string + Timeout float64 + TokenURL string + Verbose int + type ContextKey int + type Dump func(*http.Request, *http.Response, []byte, []byte, Logger, []string) + type Error struct + BodyContent []byte + CorrelationID string + Message string + Reasons []reason + StatusCode int + URL string + func (e Error) Error() string + type ForceOpt struct + Force bool + type ImportTokenCreateRequest struct + ExpiresInSeconds int + MaxAllowedRetrievals int + type ImportTokenKeyResponse struct + CreationDate *time.Time + ExpirationDate *time.Time + ID string + Nonce string + Payload string + type ImportTokenMetadata struct + CreationDate *time.Time + ExpirationDate *time.Time + ID string + MaxAllowedRetrievals int + RemainingRetrievals int + type InstancePolicies struct + Metadata PoliciesMetadata + Policies []InstancePolicy + type InstancePolicy struct + CreatedAt *time.Time + CreatedBy string + PolicyData PolicyData + PolicyType string + UpdatedAt *time.Time + UpdatedBy string + type Key struct + AlgorithmType string + CRN string + CreatedBy string + CreationDate *time.Time + Description string + EncryptedNonce string + EncryptionAlgorithm string + Expiration *time.Time + Extractable bool + ID string + IV string + LastRotateDate *time.Time + LastUpdateDate *time.Time + Name string + Payload string + State int + Tags []string + Type string + type Keys struct + Keys []Key + Metadata KeysMetadata + type KeysActionRequest struct + AAD []string + CipherText string + Payload string + PlainText string + type KeysMetadata struct + CollectionType string + NumberOfKeys int + type Logger interface + Info func(...interface{}) + func NewLogger(writer func(...interface{})) Logger + type Policies struct + Metadata PoliciesMetadata + Policies []Policy + type PoliciesMetadata struct + CollectionType string + NumberOfPolicies int + type Policy struct + CRN string + CreatedAt *time.Time + CreatedBy string + Rotation struct{ ... } + Type string + UpdatedAt *time.Time + UpdatedBy string + type PolicyData struct + Attributes Attributes + Enabled *bool + type PreferReturn int + const ReturnMinimal + const ReturnRepresentation + type Redact func(string, []string) string + type URLError struct + CorrelationID string + Err error + func (e URLError) Error() string