1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.project.management;
14 import java.security.cert.Certificate;
15 import java.util.ArrayList;
17 import org.eclipse.equinox.p2.core.UIServices;
19 public class TrustAllCertificates extends UIServices {
21 public AuthenticationInfo getUsernamePassword(String location) {
26 public AuthenticationInfo getUsernamePassword(String location, AuthenticationInfo previousInfo) {
31 public TrustInfo getTrustInfo(Certificate[][] untrustedChain, String[] unsignedDetail) {
32 ArrayList<Certificate> trustedCertificates = new ArrayList<Certificate>();
33 for (Certificate[] chain : untrustedChain) {
34 for (Certificate c : chain) {
35 trustedCertificates.add(c);
38 // Trust all certificates!
39 return new TrustInfo(trustedCertificates.toArray(new Certificate[0]), false, true);