From 14e5fed276d2511d1d9b5d862d685195761c1436 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Mon, 12 May 2025 19:58:36 +0200 Subject: [PATCH] Add Get User Private Key Copy --- api/encryption.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/encryption.go b/api/encryption.go index 2c393ee..6078e19 100644 --- a/api/encryption.go +++ b/api/encryption.go @@ -140,3 +140,11 @@ func (c *Client) DecryptMessageWithSessionKey(sessionKey *crypto.SessionKey, cip return res.String(), nil } + +func (c *Client) GetUserPrivateKeyCopy() (*crypto.Key, error) { + key, err := c.userPrivateKey.Copy() + if err != nil { + return nil, fmt.Errorf("Get Private Key Copy: %w", err) + } + return key, nil +}