Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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.

0 Replies