Documentation
¶
Index ¶
- type DecryptParams
- type EncryptParams
- type HashParams
- type KeyEntry
- type SignParams
- type Tool
- func (t *Tool) Decrypt(ctx context.Context, params map[string]interface{}) (interface{}, error)
- func (t *Tool) Encrypt(ctx context.Context, params map[string]interface{}) (interface{}, error)
- func (t *Tool) Hash(ctx context.Context, params map[string]interface{}) (interface{}, error)
- func (t *Tool) Keys(ctx context.Context, params map[string]interface{}) (interface{}, error)
- func (t *Tool) Sign(ctx context.Context, params map[string]interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecryptParams ¶
type DecryptParams struct {
Ciphertext string `json:"ciphertext"`
KeyID string `json:"keyId,omitempty"`
}
DecryptParams are the parameters for the decrypt operation.
type EncryptParams ¶
EncryptParams are the parameters for the encrypt operation.
type HashParams ¶
type HashParams struct {
Data string `json:"data"`
Algorithm string `json:"algorithm,omitempty"` // sha256, sha512
}
HashParams are the parameters for the hash operation.
type KeyEntry ¶
type KeyEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
CreatedAt string `json:"createdAt"`
LastUsedAt *string `json:"lastUsedAt,omitempty"`
}
KeyEntry represents a key in the list response.
type SignParams ¶
SignParams are the parameters for the sign operation.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool provides cryptographic operations for AI agents. Decrypted values are returned as opaque reference tokens; the plaintext never enters the agent context.
func New ¶
func New(crypto security.CryptoProvider, registry *security.KeyRegistry, refs *security.RefStore, scanner *agent.SecretScanner) *Tool
New creates a new crypto tool. If scanner is non-nil, decrypted values are registered for output scanning.
func (*Tool) Decrypt ¶
Decrypt decrypts data and returns an opaque reference token. The plaintext is stored in the RefStore and resolved at execution time.