Commit 0b3543ee42f3c7edb3eb95d125969235d7e40a01

  • Tree SHA1: 08273c2
  • Parent SHA1: 44a4cdc (ROO-1095: Release Spring Roo 1.1.0.M2 - improve reliability of system if OBR repositories unavailable)
  • raw diff | raw patch
ROO-1095: Release Spring Roo 1.1.0.M2 - modifications to support STS embedding
felix/src/main/java/org/springframework/roo/felix/pgp/PgpServiceImpl.java
(8 / 3)
  
3232import org.bouncycastle.openpgp.PGPSignature;
3333import org.bouncycastle.openpgp.PGPSignatureList;
3434import org.bouncycastle.openpgp.PGPUtil;
35import org.osgi.framework.BundleContext;
3536import org.osgi.service.component.ComponentContext;
3637import org.springframework.roo.support.osgi.UrlFindingUtils;
3738import org.springframework.roo.support.util.Assert;
5959public class PgpServiceImpl implements PgpService {
6060 @Reference private UrlInputStreamService urlInputStreamService;
6161 private boolean automaticTrust = false;
62 private ComponentContext context;
62 private BundleContext context;
6363 private static final File ROO_PGP_FILE = new File(System.getProperty("user.home") + File.separatorChar + ".spring_roo_pgp.bpg");
6464// private static final String DEFAULT_KEYSERVER_URL = "http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=";
6565 private static final String DEFAULT_KEYSERVER_URL = "http://pgp.mit.edu:11371/pks/lookup?op=get&search=";
7171 }
7272
7373 protected void activate(ComponentContext context) {
74 this.context = context;
74 this.context = context.getBundleContext();
75 trustDefaultKeysIfRequired();
76 }
77
78 protected void trustDefaultKeysIfRequired() {
7579 // Setup default keys we trust automatically if the user doesn't have a PGP file already
7680 if (!ROO_PGP_FILE.exists()) {
7781 trustDefaultKeys();
8383 }
8484
8585 private void trustDefaultKeys() {
86 Set<URL> urls = UrlFindingUtils.findMatchingClasspathResources(context.getBundleContext(), "/org/springframework/roo/felix/pgp/*.asc");
86 Set<URL> urls = UrlFindingUtils.findMatchingClasspathResources(context, "/org/springframework/roo/felix/pgp/*.asc");
8787
8888 SortedSet<URL> sortedUrls = new TreeSet<URL>(new Comparator<URL>() {
8989 public int compare(URL o1, URL o2) {

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment