diff --git a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/BaseIntegrationTest.java b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/BaseIntegrationTest.java
index d6020ce..f13df3f 100644
--- a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/BaseIntegrationTest.java
+++ b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/BaseIntegrationTest.java
@@ -88,6 +88,7 @@
             mavenBundle("org.apache.felix", "org.apache.felix.deploymentadmin").versionAsInProject(),
             mavenBundle("org.apache.felix", "org.apache.felix.eventadmin").versionAsInProject(),
             mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(),
+            mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
             
             junitBundles()
         );
diff --git a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/InstallDeploymentPackageTest.java b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/InstallDeploymentPackageTest.java
index 3651018..2b0ff9a 100644
--- a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/InstallDeploymentPackageTest.java
+++ b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/InstallDeploymentPackageTest.java
@@ -19,6 +19,7 @@
 package org.apache.felix.deploymentadmin.itest;
 
 import java.io.File;
+import java.net.URL;
 
 import org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder;
 import org.apache.felix.deploymentadmin.itest.util.DeploymentPackageBuilder.JarManifestManipulatingFilter;
@@ -37,6 +38,24 @@
 public class InstallDeploymentPackageTest extends BaseIntegrationTest
 {
     /**
+     * FELIX-518 - Test that DP with localization and signature files are properly deployed.
+     */
+    @Test
+    public void testInstallDeploymentPackageWithLocalizationAndSignatureFilesOk() throws Exception {
+        URL dpProps = getClass().getResource("/dp.properties");
+        assertNotNull(dpProps);
+        
+        DeploymentPackageBuilder dpBuilder = createNewDeploymentPackageBuilder("1.0.0");
+        dpBuilder
+            .addSignatures()
+            .add(dpBuilder.createLocalizationResource().setUrl(dpProps).setResourceProcessorPID(TEST_FAILING_BUNDLE_RP1).setFilename("dp.properties"))
+            .add(dpBuilder.createResourceProcessorResource().setUrl(getTestBundleURL("rp1")));
+
+        installDeploymentPackage(dpBuilder);
+    }
+    
+    
+    /**
      * FELIX-4409/4410/4463 - test the installation of an invalid deployment package.
      */
     @Test
diff --git a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/ArtifactData.java b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/ArtifactData.java
index d3cdd9e..a4a6939 100644
--- a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/ArtifactData.java
+++ b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/ArtifactData.java
@@ -66,6 +66,10 @@
         return m_isBundle;
     }
 
+    public boolean isLocalizationFile() {
+        return m_filename.startsWith("OSGI-INF/l10n/");
+    }
+
     public boolean isCustomizer() {
         return m_isCustomizer;
     }
diff --git a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/DeploymentPackageBuilder.java b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/DeploymentPackageBuilder.java
index 1d67ddb..727f20d 100644
--- a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/DeploymentPackageBuilder.java
+++ b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/DeploymentPackageBuilder.java
@@ -20,6 +20,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -99,23 +100,6 @@
 
     private static final int BUFFER_SIZE = 32 * 1024;
 
-    private final String m_symbolicName;
-    private final String m_version;
-    private final List<ArtifactData> m_bundles = new ArrayList<ArtifactData>();
-    private final List<ArtifactData> m_processors = new ArrayList<ArtifactData>();
-
-    private final List<ArtifactData> m_artifacts = new ArrayList<ArtifactData>();
-    private String m_fixPackageVersion;
-
-    private boolean m_verification;
-
-    private DeploymentPackageBuilder(String symbolicName, String version) {
-        m_symbolicName = symbolicName;
-        m_version = version;
-
-        m_verification = true;
-    }
-
     /**
      * Creates a new deployment package builder.
      * 
@@ -127,6 +111,27 @@
         return new DeploymentPackageBuilder(name, version);
     }
 
+    private final String m_symbolicName;
+    private final String m_version;
+    private final List<ArtifactData> m_localizationFiles = new ArrayList<ArtifactData>();
+    private final List<ArtifactData> m_bundles = new ArrayList<ArtifactData>();
+    private final List<ArtifactData> m_processors = new ArrayList<ArtifactData>();
+
+    private final List<ArtifactData> m_artifacts = new ArrayList<ArtifactData>();
+
+    private String m_fixPackageVersion;
+
+    private boolean m_addSignatures;
+    private boolean m_verification;
+
+    private DeploymentPackageBuilder(String symbolicName, String version) {
+        m_symbolicName = symbolicName;
+        m_version = version;
+
+        m_addSignatures = false;
+        m_verification = true;
+    }
+
     /**
      * Adds an artifact to the deployment package.
      * 
@@ -142,12 +147,20 @@
         else if (artifactData.isBundle()) {
             m_bundles.add(artifactData);
         }
+        else if (artifactData.isLocalizationFile()) {
+            m_localizationFiles.add(artifactData);
+        }
         else {
             m_artifacts.add(artifactData);
         }
         return this;
     }
 
+    public DeploymentPackageBuilder addSignatures() {
+        m_addSignatures = true;
+        return this;
+    }
+
     /**
      * Creates a new deployment package builder with the same symbolic name as this builder.
      * 
@@ -163,6 +176,10 @@
         return new BundleDataBuilder();
     }
 
+    public LocalizationResourceDataBuilder createLocalizationResource() {
+        return new LocalizationResourceDataBuilder();
+    }
+
     public ResourceDataBuilder createResource() {
         return new ResourceDataBuilder();
     }
@@ -207,6 +224,7 @@
      */
     public void generate(OutputStream output) throws Exception {
         List<ArtifactData> artifacts = new ArrayList<ArtifactData>();
+        artifacts.addAll(m_localizationFiles);
         artifacts.addAll(m_bundles);
         artifacts.addAll(m_processors);
         artifacts.addAll(m_artifacts);
@@ -217,6 +235,14 @@
         }
 
         Manifest m = createManifest(artifacts);
+
+        // The order in which the actual entries are added to the JAR is different than we're using for the manifest...
+        artifacts.clear();
+        artifacts.addAll(m_bundles);
+        artifacts.addAll(m_processors);
+        artifacts.addAll(m_localizationFiles);
+        artifacts.addAll(m_artifacts);
+
         writeStream(artifacts, m, output);
     }
 
@@ -293,6 +319,10 @@
                 a.putValue("DeploymentPackage-Missing", "true");
             }
 
+            if (m_addSignatures) {
+                a.putValue("SHA-256-Digest", "bogusdata=");
+            }
+
             entries.put(file.getFilename(), a);
         }
 
@@ -337,12 +367,40 @@
         }
     }
 
+    private InputStream getArtifactDataInputStream(ArtifactData file) throws IOException {
+        ResourceFilter filter = file.getFilter();
+        if (filter != null) {
+            return filter.createInputStream(file.getURL());
+        }
+        return file.getURL().openStream();
+    }
+
     private void writeStream(List<ArtifactData> files, Manifest manifest, OutputStream outputStream) throws Exception {
+        byte[] buffer = new byte[BUFFER_SIZE];
         JarOutputStream output = null;
-        InputStream fis = null;
+        InputStream is = null;
         try {
             output = new JarOutputStream(outputStream, manifest);
-            byte[] buffer = new byte[BUFFER_SIZE];
+
+            if (m_addSignatures) {
+                // Empty file index...
+                output.putNextEntry(new JarEntry("META-INF/INDEX.LIST"));
+                output.write(new byte[0]);
+                output.closeEntry();
+                
+                // Create a signature file + signature block
+                Manifest mf = new Manifest();
+                mf.getMainAttributes().put(Attributes.Name.SIGNATURE_VERSION, "1.0");
+                mf.getMainAttributes().putValue("SHA-256-Digest-Manifest", "bogusdata=");
+
+                output.putNextEntry(new JarEntry("META-INF/DP.SF"));
+                mf.write(output);
+                output.closeEntry();
+
+                output.putNextEntry(new JarEntry("META-INF/DP.DSA"));
+                output.write(new byte[] { 1, 2, 3, 4 });
+                output.closeEntry();
+            }
 
             Iterator<ArtifactData> filesIter = files.iterator();
             while (filesIter.hasNext()) {
@@ -354,35 +412,33 @@
 
                 output.putNextEntry(new JarEntry(file.getFilename()));
 
-                ResourceFilter filter = file.getFilter();
-                if (filter != null) {
-                    fis = filter.createInputStream(file.getURL());
-                }
-                else {
-                    fis = file.getURL().openStream();
-                }
-
+                is = getArtifactDataInputStream(file);
                 try {
-                    int bytes = fis.read(buffer);
-                    while (bytes != -1) {
+                    int bytes;
+                    while ((bytes = is.read(buffer)) != -1) {
                         output.write(buffer, 0, bytes);
-                        bytes = fis.read(buffer);
                     }
                 }
                 finally {
-                    fis.close();
-                    fis = null;
+                    closeSilently(is);
 
                     output.closeEntry();
                 }
             }
         }
         finally {
-            if (fis != null) {
-                fis.close();
+            closeSilently(is);
+            closeSilently(output);
+        }
+    }
+
+    static void closeSilently(Closeable resource) {
+        if (resource != null) {
+            try {
+                resource.close();
             }
-            if (output != null) {
-                output.close();
+            catch (IOException e) {
+                // Ignore...
             }
         }
     }
diff --git a/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/LocalizationResourceDataBuilder.java b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/LocalizationResourceDataBuilder.java
new file mode 100644
index 0000000..a04cea9
--- /dev/null
+++ b/deploymentadmin/itest/src/test/java/org/apache/felix/deploymentadmin/itest/util/LocalizationResourceDataBuilder.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.deploymentadmin.itest.util;
+
+/**
+ * Provides a resource data builder.
+ */
+public class LocalizationResourceDataBuilder extends ResourceDataBuilder {
+
+    public LocalizationResourceDataBuilder() {
+        // Nop
+    }
+
+    @Override
+    public LocalizationResourceDataBuilder setFilename(String filename) {
+        String prefix = "OSGI-INF/l10n/";
+        if (!filename.startsWith(prefix)) {
+            filename = prefix.concat(filename);
+        }
+        return (LocalizationResourceDataBuilder) super.setFilename(filename);
+    }
+
+    @Override
+    LocalizationResourceDataBuilder getThis() {
+        return this;
+    }
+}
diff --git a/deploymentadmin/itest/src/test/resources/dp.properties b/deploymentadmin/itest/src/test/resources/dp.properties
new file mode 100644
index 0000000..687d015
--- /dev/null
+++ b/deploymentadmin/itest/src/test/resources/dp.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# no additional properties
\ No newline at end of file
