Package io.keyko.nevermined.manager
Class SecretStoreManager
- java.lang.Object
-
- io.keyko.nevermined.manager.SecretStoreManager
-
public class SecretStoreManager extends Object
Manages the functionality related with the Secret Store
-
-
Field Summary
Fields Modifier and Type Field Description private com.oceanprotocol.secretstore.auth.ConsumerWorker
consumerWorker
private com.oceanprotocol.secretstore.auth.PublisherWorker
publisherWorker
-
Constructor Summary
Constructors Modifier Constructor Description private
SecretStoreManager(com.oceanprotocol.secretstore.core.SecretStoreDto ssDto, com.oceanprotocol.secretstore.core.EvmDto evmDto)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
decryptDocument(String resourceId, String encryptedContent)
Decrypts a document using Secret StoreString
encryptDocument(String resourceId, String content, int threshold)
Encrypts a document using Secret Storestatic SecretStoreManager
getInstance(com.oceanprotocol.secretstore.core.SecretStoreDto ssDto, com.oceanprotocol.secretstore.core.EvmDto evmDto)
Gets an instance of the SecretStoreManager
-
-
-
Method Detail
-
getInstance
public static SecretStoreManager getInstance(com.oceanprotocol.secretstore.core.SecretStoreDto ssDto, com.oceanprotocol.secretstore.core.EvmDto evmDto)
Gets an instance of the SecretStoreManager- Parameters:
ssDto
- the secret store dtoevmDto
- the EVM dto- Returns:
- an initialized instance of SecretStoreManager
-
encryptDocument
public String encryptDocument(String resourceId, String content, int threshold) throws EncryptionException
Encrypts a document using Secret Store- Parameters:
resourceId
- the resource idcontent
- content to encryptthreshold
- secret store threshold- Returns:
- a String with the encrypted content
- Throws:
EncryptionException
- EncryptionException
-
decryptDocument
public String decryptDocument(String resourceId, String encryptedContent) throws EncryptionException
Decrypts a document using Secret Store- Parameters:
resourceId
- the resource idencryptedContent
- the content to decrypt- Returns:
- a String with the decrypted content
- Throws:
EncryptionException
- EncryptionException
-
-