encryption

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Encryption API client

func New

func New(webexClient *webexsdk.Client, config *Config) *Client

New creates a new Encryption plugin

func (*Client) DecryptMessageContent

func (c *Client) DecryptMessageContent(encryptionKeyURL string, encryptedContent string) (string, error)

DecryptMessageContent attempts to decrypt message content using encryption key URL

func (*Client) DecryptText

func (c *Client) DecryptText(keyURI string, ciphertext string) (string, error)

DecryptText decrypts JWE encrypted text using a KMS key

func (*Client) GetKey

func (c *Client) GetKey(keyURI string) (*Key, error)

GetKey retrieves a key from KMS

type Config

type Config struct {
	// HTTPTimeout is the timeout for HTTP requests to the KMS service
	HTTPTimeout time.Duration
	// DefaultCluster is the default KMS cluster to use when not specified
	DefaultCluster string
	// DisableCache disables the key caching mechanism
	DisableCache bool
}

Config holds the configuration for the Encryption plugin

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration for the Encryption plugin

type JWK

type JWK struct {
	Kty string `json:"kty"`           // Key type
	Crv string `json:"crv,omitempty"` // Curve (for EC keys)
	X   string `json:"x,omitempty"`   // X coordinate (for EC keys)
	Y   string `json:"y,omitempty"`   // Y coordinate (for EC keys)
	D   string `json:"d,omitempty"`   // Private key (for EC keys)
	N   string `json:"n,omitempty"`   // Modulus (for RSA keys)
	E   string `json:"e,omitempty"`   // Exponent (for RSA keys)
	Kid string `json:"kid,omitempty"` // Key ID
	Alg string `json:"alg,omitempty"` // Algorithm
}

JWK represents a JSON Web Key

type KMSMessage

type KMSMessage struct {
	Method      string                 `json:"method,omitempty"`      // Method to perform (retrieve, create, etc.)
	URI         string                 `json:"uri,omitempty"`         // URI of the key
	ResourceURI string                 `json:"resourceUri,omitempty"` // URI of the resource
	RequestID   string                 `json:"requestId,omitempty"`   // ID of the request
	Status      string                 `json:"status,omitempty"`      // Status of the response
	Key         *Key                   `json:"key,omitempty"`         // Key in the response
	Keys        []*Key                 `json:"keys,omitempty"`        // Multiple keys in the response
	UserIDs     []string               `json:"userIds,omitempty"`     // User IDs for key creation
	KeyURIs     []string               `json:"keyUris,omitempty"`     // Key URIs for batch operations
	Resource    map[string]interface{} `json:"resource,omitempty"`    // Resource data
}

KMSMessage represents a message to/from the KMS service

type Key

type Key struct {
	URI string `json:"uri"` // URI of the key
	JWK JWK    `json:"jwk"` // JSON Web Key
}

Key represents a KMS key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL