mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
Add API Metadata Encryption
This commit is contained in:
parent
d5f79a943f
commit
b0a66d5dbf
2 changed files with 18 additions and 0 deletions
|
@ -68,3 +68,14 @@ func (c *Client) DecryptMetadata(metadataKey *crypto.Key, armoredCiphertext stri
|
|||
|
||||
return metadata, nil
|
||||
}
|
||||
|
||||
func (c *Client) EncryptMetadata(metadataKey *crypto.Key, data string) (string, error) {
|
||||
armoredCiphertext, err := c.EncryptMessageWithKey(metadataKey, data)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("Encrypting Metadata: %w", err)
|
||||
}
|
||||
|
||||
// TODO save Session Key to cache
|
||||
|
||||
return armoredCiphertext, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue