Class SecretStoreManager


  • public class SecretStoreManager
    extends Object
    Manages the functionality related with the Secret Store
    • Field Detail

      • publisherWorker

        private com.oceanprotocol.secretstore.auth.PublisherWorker publisherWorker
      • consumerWorker

        private com.oceanprotocol.secretstore.auth.ConsumerWorker consumerWorker
    • Constructor Detail

      • SecretStoreManager

        private SecretStoreManager​(com.oceanprotocol.secretstore.core.SecretStoreDto ssDto,
                                   com.oceanprotocol.secretstore.core.EvmDto evmDto)
    • 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 dto
        evmDto - 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 id
        content - content to encrypt
        threshold - 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 id
        encryptedContent - the content to decrypt
        Returns:
        a String with the decrypted content
        Throws:
        EncryptionException - EncryptionException