diff options
author | Susan Franklin | 2009-10-02 00:58:34 +0000 |
---|---|---|
committer | Susan Franklin | 2009-10-02 00:58:34 +0000 |
commit | f9303a10e035c1059144e950d022e1915cec1a11 (patch) | |
tree | a5894d5a16a49f6296d478feb283c019f0789462 /bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox | |
parent | 556838cd82368e25c1dd1d62563aaf5f7b58a95d (diff) | |
download | rt.equinox.p2-f9303a10e035c1059144e950d022e1915cec1a11.tar.gz rt.equinox.p2-f9303a10e035c1059144e950d022e1915cec1a11.tar.xz rt.equinox.p2-f9303a10e035c1059144e950d022e1915cec1a11.zip |
Bug 290984 - [core] merge IServiceUI and IServiceUICheckUnsigned
Bug 291049 - [ui] IServiceUI declaration using ds causes test failures in N20090930
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java | 67 |
1 files changed, 56 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java index 3f3cf1000..120473ab3 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/core/IServiceUI.java @@ -51,6 +51,54 @@ public interface IServiceUI { } /** + * Trust information returned from a trust request. * + */ + public static class TrustInfo { + private final Certificate[] trustedCertificates; + private final boolean saveTrustedCertificates; + private final boolean trustUnsigned; + + public TrustInfo(Certificate[] trusted, boolean save, boolean trustUnsigned) { + this.trustedCertificates = trusted; + this.saveTrustedCertificates = save; + this.trustUnsigned = trustUnsigned; + } + + /** + * Return an array of the certificates that should be trusted for the + * requested operation. + * + * @return the trusted certificates, or <code>null</code> if there are + * no certificates that were verified as trusted. + */ + public Certificate[] getTrustedCertificates() { + return trustedCertificates; + } + + /** + * Return a boolean indicating whether the trusted certificates should + * be persisted for future operations. + * + * @return <code>true</code> if the trusted certificates should be persisted, <code>false</code> if + * the trust only applies for this request. + */ + public boolean persistTrust() { + return saveTrustedCertificates; + } + + /** + * Return a boolean indicating whether the unsigned content should be trusted + * during this operation. + * + * @return <code>true</code> if the unsigned content should be trusted, or if there was no unsigned content, + * and <code>false</code> if there was unsigned content and should not be trusted. + */ + public boolean trustUnsignedContent() { + return trustUnsigned; + } + } + + /** * Opens a UI prompt for authentication details * * @param location - the location requiring login details, may be <code>null</code>. @@ -69,17 +117,14 @@ public interface IServiceUI { public AuthenticationInfo getUsernamePassword(String location, AuthenticationInfo previousInfo); /** - * Displays a list of certificates to the user. + * Opens a UI prompt to capture information about trusted content. * - * @param certificates - a list of certificates to display to the user - * @return An array of certificates that have been accepted. - */ - public Certificate[] showCertificates(Certificate[][] certificates); - - /** - * Prompts the user that they are installing unsigned content. - * @param details Detailed information about the items that have unsigned content. - * @return <code>true</code> if the installation should proceed, and <code>false</code> otherwise. + * @param certificates - an array of certificate chains for which there is no current trust anchor. May be + * <code>null</code>, which means there are no untrusted certificate chains. + * @param unsignedDetail - an array of strings, where each String describes content that is not signed. + * May be <code>null</code>, which means there is no unsigned content + * @return the TrustInfo that describes the user's choices for trusting certificates and + * unsigned content. */ - public boolean promptForUnsignedContent(String[] details); + public TrustInfo getTrustInfo(Certificate[][] untrustedChain, String[] unsignedDetail); } |