Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth holds the configuration for authentication with a KMS server.
cert: the path to the client certificate file. key: the path to the client key file. cacert: the path to the CA certificate file.
func NewClientCertificateAuth ¶
NewClientCertificateAuth creates a new instance of the Auth struct for client certificate authentication.
Parameters: - cert: the path to the client certificate file. - key: the path to the client key file. - cacert: the path to the CA certificate file.
Returns: - *Auth: a pointer to the Auth struct, or nil if any of the parameters are empty.
func (*Auth) IsClientCertAuth ¶
IsClientCertAuth checks if the Auth struct has a valid client certificate, key, and CA certificate.
Returns: - bool: true if all fields are non-nil, false otherwise.
type KMSHandler ¶
type KMSHandler struct {
// contains filtered or unexported fields
}
KMSHandler is a client for a kms KMS (Key Management Service)
func NewKMSServer ¶
func NewKMSServer(url string, timeout int, kmsAuth *Auth) *KMSHandler
NewKMSServer creates a new KMSHandler instance for interacting with a KMS server.
Parameters: - url: the URL of the KMS server. - timeout: the timeout duration for HTTP requests in seconds. - kmsAuth: the authentication configuration for the KMS server.
Returns: - *KMSHandler: a pointer to the KMSHandler instance.
func (*KMSHandler) GetKeyByID ¶
func (q *KMSHandler) GetKeyByID(keyID string) (*Key, error)
GetKeyByID fetches a key from a KMS by its ID.
keyID string *Key, error
func (*KMSHandler) GetNewKey ¶
func (q *KMSHandler) GetNewKey() (*Key, error)
GetNewKey fetches a new key from the KMS.
No parameters. Returns a pointer to a Key struct and an error.