Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

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

Avatar

Administrator

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.



Kautuk Sahni
0 Replies