Package com.oceanprotocol.squid.api.impl
Class SecretStoreImpl
- java.lang.Object
-
- com.oceanprotocol.squid.api.impl.SecretStoreImpl
-
- All Implemented Interfaces:
SecretStoreAPI
public class SecretStoreImpl extends Object implements SecretStoreAPI
Implementation of SecretStoreAPI
-
-
Field Summary
Fields Modifier and Type Field Description private SecretStoreManager
secretStoreManager
-
Constructor Summary
Constructors Constructor Description SecretStoreImpl(SecretStoreManager secretStoreManager)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
decrypt(String documentId, String encryptedContent)
Decrypts a document using Secret StoreString
encrypt(String documentId, String content, int threshold)
Encrypts a document using Secret Store
-
-
-
Field Detail
-
secretStoreManager
private SecretStoreManager secretStoreManager
-
-
Constructor Detail
-
SecretStoreImpl
public SecretStoreImpl(SecretStoreManager secretStoreManager)
Constructor- Parameters:
secretStoreManager
- the secretStore Manager
-
-
Method Detail
-
encrypt
public String encrypt(String documentId, String content, int threshold) throws EncryptionException
Description copied from interface:SecretStoreAPI
Encrypts a document using Secret Store- Specified by:
encrypt
in interfaceSecretStoreAPI
- Parameters:
documentId
- the id of the documentcontent
- the contentthreshold
- secret store threshold- Returns:
- a String with the encrypted content
- Throws:
EncryptionException
- EncryptionException
-
decrypt
public String decrypt(String documentId, String encryptedContent) throws EncryptionException
Description copied from interface:SecretStoreAPI
Decrypts a document using Secret Store- Specified by:
decrypt
in interfaceSecretStoreAPI
- Parameters:
documentId
- the id of the documentencryptedContent
- the encrypted content of the document- Returns:
- a String with the decrypted content
- Throws:
EncryptionException
- EncryptionException
-
-