How to encrypt and decrypt OSGI config values | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
May 4, 2022

How to encrypt and decrypt OSGI config values | AEM Community Blog Seeding

  • May 4, 2022
  • 0 replies
  • 651 views

BlogImage.jpg

How to encrypt and decrypt OSGI config values by Lhotsetechnologies

Abstract

First, we have to make a service configuration by using the code given below. In this code I am showing you the normal way to show osgi config value.

@Component(service = TestService.class, immediate = true)

@Designate(ocd = TestService.TestConfig.class)

public class TestService {

@ObjectClassDefinition(name = “TestConfig”, description = “This is the test config”)

public @interface TestConfig {

@AttributeDefinition(name = “Title”, description = “Enter the title”)

String myTitle();

@AttributeDefinition(name = “Description”, description = “Enter the description”)

String myDesc();

}

private String serviceTitle;

private String serviceDesc;

@Activate @Modified

private void init(TestConfig testConfig) {

serviceTitle = testConfig.myTitle();

serviceDesc = testConfig.myDesc();

}

public String getServiceTitle() {

return serviceTitle;

}

public String getServiceDesc() {

return serviceDesc;

}

}

By using the above code we will get our service configuration.

Read Full Blog

How to encrypt and decrypt OSGI config values

Q&A

Please use this thread to ask the related questions.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.