All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.osgi.signedcontent.SignedContentFactory Maven / Gradle / Ivy

There is a newer version: 1.9.22.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2007, 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.File;
import java.io.IOException;
import java.security.*;
import java.security.cert.CertificateException;
import org.osgi.framework.Bundle;

/**
 * A factory used to create {@link SignedContent} objects.
 * 

* The framework will register a factory implementation as an OSGi service. * This service can be used to get SignedContent for a bundle. * It can also be used to get SignedContent for a repository file. * The supported formats for file repositories are jar files and directories containing the * content of an extracted jar. *

*

* This interface is not intended to be implemented by clients. *

* @since 3.4 * @noimplement This interface is not intended to be implemented by clients. */ public interface SignedContentFactory { /** * Returns a SignedContent object for the specified content of a repository. * @param content the content of the repository * @return signed content for the specified repository * @throws IOException if an IO exception occurs while reading the repository * @throws NoSuchProviderException if there's no security provider for the signed content * @throws NoSuchAlgorithmException if the cryptographic algorithm is not available for the signed content * @throws CertificateException if there is a problem with one of the certificates of the signed content * @throws SignatureException if there is a problem with one of the signatures of the signed content * @throws InvalidKeyException if there is a problem with one of the certificate keys of the signed content */ public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException; /** * Returns a SignedContent object for the specified bundle. * @param bundle the bundle to get a signed content for. * @return signed content for the specified bundle. * @throws IOException if an IO exception occurs while reading the bundle content * @throws NoSuchProviderException if there's no security provider for the signed content * @throws NoSuchAlgorithmException if the cryptographic algorithm is not available for the signed content * @throws CertificateException if there is a problem with one of the certificates of the signed content * @throws SignatureException if there is a problem with one of the signatures of the signed content * @throws InvalidKeyException if there is a problem with one of the certificate keys of the signed content */ public SignedContent getSignedContent(Bundle bundle) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy