Class ArtifactEncryptionService

java.lang.Object
org.eclipse.hawkbit.artifact.encryption.ArtifactEncryptionService

public final class ArtifactEncryptionService extends Object
Service responsible for encryption operations. Should be registered as a bean in order its autowired dependencies to be injected.
  • Constructor Details

    • ArtifactEncryptionService

      public ArtifactEncryptionService()
  • Method Details

    • getInstance

      public static ArtifactEncryptionService getInstance()
      Returns:
      the artifact encryption service singleton instance
    • setArtifactEncryption

      @Autowired(required=false) public void setArtifactEncryption(ArtifactEncryption artifactEncryption)
    • setArtifactEncryptionSecretsStore

      @Autowired(required=false) public void setArtifactEncryptionSecretsStore(ArtifactEncryptionSecretsStorage artifactEncryptionSecretsStore)
    • isEncryptionSupported

      public boolean isEncryptionSupported()
      Checks if required encryption and secrets store beans are present.
      Returns:
      if encryption is supported
    • addEncryptionSecrets

      public void addEncryptionSecrets(long id)
      Generates encryption secrets and saves them in secret store by id reference.
      Parameters:
      id - id of the secrets to be generated
    • encryptArtifact

      public InputStream encryptArtifact(long id, InputStream artifactStream)
      Encrypts artifact stream using the keys retrieved from secrets store by id reference.
      Parameters:
      id - id of the secrets
      artifactStream - artifact stream to encrypt
      Returns:
      encrypted input stream
    • decryptArtifact

      public InputStream decryptArtifact(long id, InputStream encryptedArtifactStream)
      Decrypts artifact stream using the keys retrieved from secrets store by id reference.
      Parameters:
      id - id of the secrets
      encryptedArtifactStream - artifact stream to decrypt
      Returns:
      decrypted input stream
    • encryptionSizeOverhead

      public int encryptionSizeOverhead()
      Size of the underlying encryption algorithm overhead in bytes
      Returns:
      encryption overhead in byte