<!ELEMENT extension (cipherProvider+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED
><!ELEMENT cipherProvider EMPTY>
<!ATTLIST cipherProvider
fileExtension CDATA #REQUIRED
class CDATA #REQUIRED
>Defines the file extension and its corresponding provider of javax.crypto.Cipher instances for the encryption of connection profile store files.
org.eclipse.datatools.connectivity.security.ICipherProvider
interface to provide the javax.crypto.Cipher instances for the encryption and decryption of connection profile store files.
org.eclipse.datatools.connectivity.security.CipherProviderBase
base class implementation, which reads a secret (symmetric) key specification from a bundled resource.
<extension
id="org.company.connectivity.security.cipherProvider"
point="org.eclipse.datatools.connectivity.cipherProvider">
<cipherProvider
fileExtension="profile"
class="org.company.connectivity.security.ProfileStoreCipherProvider">
</cipherProvider>
<cipherProvider
fileExtension="default"
class="org.company.connectivity.security.ProfileStoreCipherProvider">
</cipherProvider>
</extension>
This example registers org.company.connectivity.security.ProfileStoreCipherProvider as the provider for files with the extension ".profile" and for those with no file extension.
import org.eclipse.core.runtime.Platform;
import org.eclipse.datatools.connectivity.security.CipherProviderBase;
import org.eclipse.datatools.connectivity.security.ICipherProvider;
import org.osgi.framework.Bundle;
public class ProfileStoreCipherProvider extends CipherProviderBase
implements ICipherProvider
{
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.security.CipherProviderBase#getKeyResource()
*/
@Override
protected URL getKeyResource()
{
Bundle bundle = Platform.getBundle( "org.company.connectivity.security" );
return bundle != null ?
bundle.getResource( "cpkey" ) : //$NON-NLS-1$
super.getKeyResource();
}
}
org.eclipse.datatools.connectivity.security
package. See the package's JavaDoc documentation for more information.
org.eclipse.datatools.connectivity.security.CipherProviderBase
is the base class implementation of the org.eclipse.datatools.connectivity.security.ICipherProvider
interface. It uses a default bundled encryption key as its javax.crypto.spec.SecretKeySpec.
Copyright (c) 2011 Actuate Corporation. All rights reserved. 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/ .