Class ArtifactEncryptionService
java.lang.Object
org.eclipse.hawkbit.artifact.encryption.ArtifactEncryptionService
Service responsible for encryption operations. Should be registered as a bean in order its autowired dependencies to be injected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEncryptionSecrets(long id) Generates encryption secrets and saves them in secret store by id reference.decryptArtifact(long id, InputStream encryptedArtifactStream) Decrypts artifact stream using the keys retrieved from secrets store by id reference.encryptArtifact(long id, InputStream artifactStream) Encrypts artifact stream using the keys retrieved from secrets store by id reference.intSize of the underlying encryption algorithm overhead in bytesstatic ArtifactEncryptionServicebooleanChecks if required encryption and secrets store beans are present.voidsetArtifactEncryption(ArtifactEncryption artifactEncryption) voidsetArtifactEncryptionSecretsStore(ArtifactEncryptionSecretsStorage artifactEncryptionSecretsStore)
-
Constructor Details
-
ArtifactEncryptionService
public ArtifactEncryptionService()
-
-
Method Details
-
getInstance
- Returns:
- the artifact encryption service singleton instance
-
setArtifactEncryption
-
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
Encrypts artifact stream using the keys retrieved from secrets store by id reference.- Parameters:
id- id of the secretsartifactStream- artifact stream to encrypt- Returns:
- encrypted input stream
-
decryptArtifact
Decrypts artifact stream using the keys retrieved from secrets store by id reference.- Parameters:
id- id of the secretsencryptedArtifactStream- 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
-