Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 190569947e807ddd9efcbeb64a8840b45396b0e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************************
 * Copyright (c) 2005, 2012 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.osgi.signedcontent;

import java.io.IOException;

// encapsulates the status of an entry: isSigned, timestamp info, SignerInfos, etc
// implemented by SignedBundleFile.SignedBundleEntry
/**
 * A <code>SignedContentEntry</code> represents a content entry which may be
 * signed.
 * <p>
 * A <code>SignedContentEntry</code> object is intended to provide information about 
 * the signers of the content entry, and cannot be used to access the actual data of the entry.
 * </p>
 * <p>
 * This interface is not intended to be implemented by clients.
 * </p>
 * @since 3.4
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface SignedContentEntry {
	/**
	 * Returns the name of the entry.
	 * @return the name of the entry.
	 */
	public String getName();

	/**
	 * Returns the signer infos for this <code>SignedContentEntry</code>.  If the entry
	 * is not signed then an empty array is returned.
	 * @return the signer infos for this <code>SignedContentEntry</code>
	 */
	public SignerInfo[] getSignerInfos();

	/**
	 * Returns true if the entry is signed; false otherwise.  This is a convenience method
	 * equivalent to calling <code>{@link #getSignerInfos()}.length &gt; 0</code> 
	 * @return true if the content is signed
	 */
	public boolean isSigned();

	// Does the digest of this entry match what is expected?
	// TODO: what does this mean in the face of multiple signers
	/**
	 * Verifies the content of this this entry is valid.
	 * @throws IOException if an error occurred reading the entry content
	 * @throws InvalidContentException if the entry content is not valid
	 */
	public void verify() throws IOException, InvalidContentException;

}

Back to the top