Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 487F910807 for ; Sat, 10 Aug 2013 22:27:41 +0000 (UTC) Received: (qmail 62953 invoked by uid 500); 10 Aug 2013 22:27:40 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 62886 invoked by uid 500); 10 Aug 2013 22:27:40 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 62879 invoked by uid 99); 10 Aug 2013 22:27:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Aug 2013 22:27:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Aug 2013 22:27:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 20F202388C9E for ; Sat, 10 Aug 2013 22:25:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r874057 [30/31] - in /websites/production/commons/content/sandbox/commons-openpgp: ./ apidocs/ apidocs/org/apache/commons/openpgp/ apidocs/org/apache/commons/openpgp/ant/ apidocs/org/apache/commons/openpgp/ant/class-use/ apidocs/org/apache/... Date: Sat, 10 Aug 2013 22:25:21 -0000 To: commits@commons.apache.org From: dennisl@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130810222531.20F202388C9E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/SignatureStatus.html ============================================================================== --- websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/SignatureStatus.html (original) +++ websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/SignatureStatus.html Sat Aug 10 22:25:17 2013 @@ -1,89 +1,88 @@ - - - - -SignatureStatus xref - - - -
-
-1   package org.apache.commons.openpgp;
-2   
-3   /*
-4    * Licensed to the Apache Software Foundation (ASF) under one or more
-5    * contributor license agreements.  See the NOTICE file distributed with
-6    * this work for additional information regarding copyright ownership.
-7    * The ASF licenses this file to You under the Apache License, Version 2.0
-8    * (the "License"); you may not use this file except in compliance with
-9    * the License.  You may obtain a copy of the License at
-10   *
-11   *      http://www.apache.org/licenses/LICENSE-2.0
-12   *
-13   * Unless required by applicable law or agreed to in writing, software
-14   * distributed under the License is distributed on an "AS IS" BASIS,
-15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-16   * See the License for the specific language governing permissions and
-17   * limitations under the License.
-18   */
-19  
-20  /**
-21   * Enumerated type indicating the status of data that was signed.
-22   * <p/>
-23   * Values:
-24   * <ul>
-25   * <li><code>VALID_TRUSTED</code></li>
-26   * <li><code>VALID_UNTRUSTED</code></li>
-27   * <li><code>INVALID</code></li>
-28   * </ul>
-29   *
-30   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
-31   * @todo incorporate levels of trust
-32   */
-33  public class SignatureStatus
-34  {
-35      /**
-36       * Status that indicates the signature is valid, and from a trusted source.
-37       */
-38      public static SignatureStatus VALID_TRUSTED = new SignatureStatus( true, true );
-39  
-40      /**
-41       * Status that indicates the signature is valid, but from an unknown or untrusted source.
-42       */
-43      public static SignatureStatus VALID_UNTRUSTED = new SignatureStatus( true, false );
-44  
-45      /**
-46       * Status that indicates the signature is invalid.
-47       */
-48      public static SignatureStatus INVALID = new SignatureStatus( false, false );
-49  
-50      /**
-51       * Whether the signature is valid.
-52       */
-53      private final boolean valid;
-54  
-55      /**
-56       * Whether the signature is trusted.
-57       */
-58      private final boolean trusted;
-59  
-60      private SignatureStatus( boolean valid, boolean trusted )
-61      {
-62          this.valid = valid;
-63          this.trusted = trusted;
-64      }
-65  
-66      public boolean isValid()
-67      {
-68          return valid;
-69      }
-70  
-71      public boolean isTrusted()
-72      {
-73          return trusted;
-74      }
-75  }
-
-
- + + + + +SignatureStatus xref + + + +
 
+1   package org.apache.commons.openpgp;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *      http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  /**
+21   * Enumerated type indicating the status of data that was signed.
+22   * <p/>
+23   * Values:
+24   * <ul>
+25   * <li><code>VALID_TRUSTED</code></li>
+26   * <li><code>VALID_UNTRUSTED</code></li>
+27   * <li><code>INVALID</code></li>
+28   * </ul>
+29   *
+30   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+31   * @todo incorporate levels of trust
+32   */
+33  public class SignatureStatus
+34  {
+35      /**
+36       * Status that indicates the signature is valid, and from a trusted source.
+37       */
+38      public static SignatureStatus VALID_TRUSTED = new SignatureStatus( true, true );
+39  
+40      /**
+41       * Status that indicates the signature is valid, but from an unknown or untrusted source.
+42       */
+43      public static SignatureStatus VALID_UNTRUSTED = new SignatureStatus( true, false );
+44  
+45      /**
+46       * Status that indicates the signature is invalid.
+47       */
+48      public static SignatureStatus INVALID = new SignatureStatus( false, false );
+49  
+50      /**
+51       * Whether the signature is valid.
+52       */
+53      private final boolean valid;
+54  
+55      /**
+56       * Whether the signature is trusted.
+57       */
+58      private final boolean trusted;
+59  
+60      private SignatureStatus( boolean valid, boolean trusted )
+61      {
+62          this.valid = valid;
+63          this.trusted = trusted;
+64      }
+65  
+66      public boolean isValid()
+67      {
+68          return valid;
+69      }
+70  
+71      public boolean isTrusted()
+72      {
+73          return trusted;
+74      }
+75  }
+
+
+ Modified: websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/UnknownKeyException.html ============================================================================== --- websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/UnknownKeyException.html (original) +++ websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/UnknownKeyException.html Sat Aug 10 22:25:17 2013 @@ -1,51 +1,49 @@ - - - - -UnknownKeyException xref - - - -
-
-1   package org.apache.commons.openpgp;
-2   
-3   /*
-4    * Licensed to the Apache Software Foundation (ASF) under one or more
-5    * contributor license agreements.  See the NOTICE file distributed with
-6    * this work for additional information regarding copyright ownership.
-7    * The ASF licenses this file to You under the Apache License, Version 2.0
-8    * (the "License"); you may not use this file except in compliance with
-9    * the License.  You may obtain a copy of the License at
-10   *
-11   *      http://www.apache.org/licenses/LICENSE-2.0
-12   *
-13   * Unless required by applicable law or agreed to in writing, software
-14   * distributed under the License is distributed on an "AS IS" BASIS,
-15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-16   * See the License for the specific language governing permissions and
-17   * limitations under the License.
-18   */
-19  
-20  /**
-21   * An exception occurring during the verification of a signature, when the key is not found in the keyring.
-22   *
-23   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
-24   */
-25  public class UnknownKeyException
-26      extends OpenPgpException
-27  {
-28      public UnknownKeyException( String message )
-29      {
-30          super( message );
-31      }
-32  
-33      public UnknownKeyException( String message, Throwable cause )
-34      {
-35          super( message, cause );
-36      }
-37  }
-
-
- + + + + +UnknownKeyException xref + + + +
 
+1   package org.apache.commons.openpgp;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one or more
+5    * contributor license agreements.  See the NOTICE file distributed with
+6    * this work for additional information regarding copyright ownership.
+7    * The ASF licenses this file to You under the Apache License, Version 2.0
+8    * (the "License"); you may not use this file except in compliance with
+9    * the License.  You may obtain a copy of the License at
+10   *
+11   *      http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing, software
+14   * distributed under the License is distributed on an "AS IS" BASIS,
+15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+16   * See the License for the specific language governing permissions and
+17   * limitations under the License.
+18   */
+19  
+20  /**
+21   * An exception occurring during the verification of a signature, when the key is not found in the keyring.
+22   *
+23   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+24   */
+25  public class UnknownKeyException extends OpenPgpException
+26  {
+27      public UnknownKeyException( String message )
+28      {
+29          super( message );
+30      }
+31  
+32      public UnknownKeyException( String message, Throwable cause )
+33      {
+34          super( message, cause );
+35      }
+36  }
+
+
+ Modified: websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/ant/OpenPgpSignerTask.html ============================================================================== --- websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/ant/OpenPgpSignerTask.html (original) +++ websites/production/commons/content/sandbox/commons-openpgp/xref/org/apache/commons/openpgp/ant/OpenPgpSignerTask.html Sat Aug 10 22:25:17 2013 @@ -1,229 +1,226 @@ - - - - -OpenPgpSignerTask xref - - - -
-
-1   /*
-2    * Licensed to the Apache Software Foundation (ASF) under one or more
-3    * contributor license agreements.  See the NOTICE file distributed with
-4    * this work for additional information regarding copyright ownership.
-5    * The ASF licenses this file to You under the Apache License, Version 2.0
-6    * (the "License"); you may not use this file except in compliance with
-7    * the License.  You may obtain a copy of the License at
-8    *
-9    *      http://www.apache.org/licenses/LICENSE-2.0
-10   *
-11   * Unless required by applicable law or agreed to in writing, software
-12   * distributed under the License is distributed on an "AS IS" BASIS,
-13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-14   * See the License for the specific language governing permissions and
-15   * limitations under the License.
-16   */
-17  package org.apache.commons.openpgp.ant;
-18  
-19  import org.apache.tools.ant.Task;
-20  import org.apache.tools.ant.BuildException;
-21  import org.apache.tools.ant.DirectoryScanner;
-22  import org.apache.tools.ant.util.FileNameMapper;
-23  import org.apache.tools.ant.util.GlobPatternMapper;
-24  import org.apache.tools.ant.util.FileUtils;
-25  import org.apache.tools.ant.types.FileSet;
-26  import org.apache.tools.ant.types.Mapper;
-27  import org.apache.commons.openpgp.*;
-28  import org.bouncycastle.openpgp.PGPException;
-29  
-30  import java.io.*;
-31  import java.util.Collection;
-32  import java.util.ArrayList;
-33  import java.util.Iterator;
-34  
-35  /**
-36   */
-37  public class OpenPgpSignerTask extends Task {
-38      private File secring;
-39      private File pubring;
-40      private String password;
-41      private String keyId;
-42      private Collection tosign = new ArrayList();
-43      private File artefact;
-44      private boolean asciiarmor = true;
-45      private Mapper mapperElement;
-46  
-47      /**
-48       * set the secret keyring
-49       * @param secring secret keyring file
-50       */
-51      public void setSecring(File secring) {
-52          this.secring = secring;
-53      }
-54  
-55      /**
-56       * set the public keyring
-57       * @param pubring public keyring file
-58       */
-59      public void setPubring(File pubring) {
-60          this.pubring = pubring;
-61      }
-62  
-63      /**
-64       * set the key id
-65       * @param keyId
-66       */
-67      public void setKeyId(String keyId) {
-68          this.keyId = keyId;
-69      }
-70  
-71      /**
-72       * asciiarmor the signature ?
-73       * @param asciiarmor ascii armored signature ?
-74       */
-75      public void setAsciiarmor(boolean asciiarmor) {
-76          this.asciiarmor = asciiarmor;
-77      }
-78  
-79      /**
-80       * set the value of the password
-81       * @param password value of the password
-82       */
-83      public void setPassword(String password) {
-84          this.password = password;
-85      }
-86  
-87      /**
-88       * artefact to be signed
-89       * @param artefact artefact to be signed
-90       */
-91      public void setArtefact(File artefact) {
-92          this.artefact = artefact;
-93      }
-94  
-95  
-96      public void add(FileSet fs) {
-97          tosign.add(fs);
-98      }
-99  
-100     /**
-101      * Define the mapper to map source to destination files.
-102      * @return a mapper to be configured.
-103      * @exception org.apache.tools.ant.BuildException if more than one mapper is defined.
-104      */
-105     public Mapper createMapper() throws BuildException {
-106         if (mapperElement != null) {
-107             throw new BuildException("Cannot define more than one mapper",
-108                     getLocation());
-109         }
-110         mapperElement = new Mapper(getProject());
-111         return mapperElement;
-112     }
-113 
-114     public void execute() {
-115         if (secring == null) {
-116             throw new BuildException("secring attribute compulsory");
-117         }
-118         if (pubring == null) {
-119             throw new BuildException("pubring attribute compulsory");
-120         }
-121         if (password == null) {
-122             throw new BuildException("password attribute compulsory");
-123         }
-124         if (tosign.size() == 0 && artefact == null) {
-125             throw new BuildException("supply the attribute tosign or one nested fileset");
-126         }
-127         if (!secring.exists() || !secring.canRead()) {
-128             throw new  BuildException("secret keyring file does not exist or is not readable");
-129         }
-130         if (!pubring.exists() || !pubring.canRead()) {
-131             throw new  BuildException("public keyring file does not exist or is not readable");
-132         }
-133         FileInputStream secStream;
-134         FileInputStream pubStream;
-135         KeyRing keyRing = null;
-136         try {
-137             secStream = new FileInputStream(secring);
-138             pubStream = new FileInputStream(pubring);
-139             keyRing = new BouncyCastleKeyRing(secStream,
-140                     pubStream, password.toCharArray() );
-141         } catch (IOException ioe) {
-142             throw new BuildException(ioe);
-143         } catch (PGPException pgpe) {
-144             throw new BuildException(pgpe);
-145         }
-146         if (artefact != null) {
-147             dosign(keyRing, artefact);
-148         }
-149         if (tosign.size() != 0) {
-150             for (Iterator it = tosign.iterator(); it.hasNext(); ) {
-151                 FileSet fs = (FileSet) it.next();
-152                 dosign(keyRing, fs);
-153             }
-154         }
-155         FileUtils.close(secStream);
-156         FileUtils.close(pubStream);
-157     }
-158     private void dosign(KeyRing keyRing, FileSet fs) {
-159         DirectoryScanner ds = fs.getDirectoryScanner(getProject());
-160         String[] artefacts = ds.getIncludedFiles();
-161         for (int counter = 0; counter < artefacts.length; counter++) {
-162             dosign(keyRing,
-163                     new File(fs.getDir(getProject()), artefacts[counter]), fs.getDir(getProject()), artefacts[counter]);
-164         }
-165     }
-166     private void dosign(KeyRing keyRing, File oneartefact) {
-167         dosign(keyRing, oneartefact, oneartefact.getParentFile(), oneartefact.getName());
-168     }
-169     private void dosign(KeyRing keyRing, File oneartefact, File basedir, String relpath) {
-170         FileInputStream fis = null;
-171         FileOutputStream fos = null;
-172         File signature;
-173 
-174         try {
-175             fis = new FileInputStream(oneartefact);
-176             FileNameMapper mapper = getMapper();
-177             String [] mappedFiles = mapper.mapFileName(relpath);
-178             if (mappedFiles == null || mappedFiles.length != 1) {
-179                 throw new BuildException("mapper returned more or less than one output");
-180             }
-181             signature = new File(basedir, mappedFiles[0]);
-182             fos = new FileOutputStream(signature);
-183             OpenPgpSigner signer = new BouncyCastleOpenPgpSigner();
-184             signer.detachedSign(fis, fos, keyId, keyRing, asciiarmor);
-185         } catch (FileNotFoundException fnfe) {
-186             throw new BuildException(fnfe);
-187         } catch (IOException ioe) {
-188             throw new BuildException(ioe);
-189         } catch (OpenPgpException opgpe) {
-190             throw new BuildException(opgpe);
-191         }
-192         FileUtils.close(fos);
-193         FileUtils.close(fis);
-194 
-195     }
-196     /**
-197      * returns the mapper to use based on nested elements or the
-198      */
-199     private FileNameMapper getMapper() {
-200         FileNameMapper mapper = null;
-201         if (mapperElement != null) {
-202             mapper = mapperElement.getImplementation();
-203         } else {
-204             mapper = new GlobPatternMapper();
-205             mapper.setFrom("*");
-206             if (asciiarmor) {
-207                 mapper.setTo("*.asc");
-208             } else {
-209                 mapper.setTo("*.sig");
-210             }
-211         }
-212         return mapper;
-213     }
-214 
-215 }
-
-
- + + + + +OpenPgpSignerTask xref + + + +
 
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.openpgp.ant;
+18  
+19  import org.apache.tools.ant.Task;
+20  import org.apache.tools.ant.BuildException;
+21  import org.apache.tools.ant.DirectoryScanner;
+22  import org.apache.tools.ant.util.FileNameMapper;
+23  import org.apache.tools.ant.util.GlobPatternMapper;
+24  import org.apache.tools.ant.util.FileUtils;
+25  import org.apache.tools.ant.types.FileSet;
+26  import org.apache.tools.ant.types.Mapper;
+27  import org.apache.commons.openpgp.*;
+28  import org.bouncycastle.openpgp.PGPException;
+29  
+30  import java.io.*;
+31  import java.util.Collection;
+32  import java.util.ArrayList;
+33  import java.util.Iterator;
+34  
+35  /**
+36   */
+37  public class OpenPgpSignerTask extends Task {
+38      private File secring;
+39      private File pubring;
+40      private String password;
+41      private String keyId;
+42      private Collection<FileSet> tosign = new ArrayList<FileSet>();
+43      private File artefact;
+44      private boolean asciiarmor = true;
+45      private Mapper mapperElement;
+46  
+47      /**
+48       * set the secret keyring
+49       * @param secring secret keyring file
+50       */
+51      public void setSecring(File secring) {
+52          this.secring = secring;
+53      }
+54  
+55      /**
+56       * set the public keyring
+57       * @param pubring public keyring file
+58       */
+59      public void setPubring(File pubring) {
+60          this.pubring = pubring;
+61      }
+62  
+63      /**
+64       * set the key id
+65       * @param keyId
+66       */
+67      public void setKeyId(String keyId) {
+68          this.keyId = keyId;
+69      }
+70  
+71      /**
+72       * asciiarmor the signature ?
+73       * @param asciiarmor ascii armored signature ?
+74       */
+75      public void setAsciiarmor(boolean asciiarmor) {
+76          this.asciiarmor = asciiarmor;
+77      }
+78  
+79      /**
+80       * set the value of the password
+81       * @param password value of the password
+82       */
+83      public void setPassword(String password) {
+84          this.password = password;
+85      }
+86  
+87      /**
+88       * artefact to be signed
+89       * @param artefact artefact to be signed
+90       */
+91      public void setArtefact(File artefact) {
+92          this.artefact = artefact;
+93      }
+94  
+95  
+96      public void add(FileSet fs) {
+97          tosign.add(fs);
+98      }
+99  
+100     /**
+101      * Define the mapper to map source to destination files.
+102      * @return a mapper to be configured.
+103      * @exception org.apache.tools.ant.BuildException if more than one mapper is defined.
+104      */
+105     public Mapper createMapper() throws BuildException {
+106         if (mapperElement != null) {
+107             throw new BuildException("Cannot define more than one mapper",
+108                     getLocation());
+109         }
+110         mapperElement = new Mapper(getProject());
+111         return mapperElement;
+112     }
+113 
+114     public void execute() {
+115         if (secring == null) {
+116             throw new BuildException("secring attribute compulsory");
+117         }
+118         if (pubring == null) {
+119             throw new BuildException("pubring attribute compulsory");
+120         }
+121         if (password == null) {
+122             throw new BuildException("password attribute compulsory");
+123         }
+124         if (tosign.size() == 0 && artefact == null) {
+125             throw new BuildException("supply the attribute 'artefact' or one nested fileset");
+126         }
+127         if (!secring.exists() || !secring.canRead()) {
+128             throw new  BuildException("secret keyring file '" + secring.getAbsolutePath() + "' does not exist or is not readable");
+129         }
+130         if (!pubring.exists() || !pubring.canRead()) {
+131             throw new  BuildException("public keyring file '" + pubring.getAbsolutePath() + "' does not exist or is not readable");
+132         }
+133         FileInputStream secStream;
+134         FileInputStream pubStream;
+135         KeyRing keyRing = null;
+136         try {
+137             secStream = new FileInputStream(secring);
+138             pubStream = new FileInputStream(pubring);
+139             keyRing = new BouncyCastleKeyRing(secStream,
+140                     pubStream, password.toCharArray() );
+141         } catch (IOException ioe) {
+142             throw new BuildException(ioe);
+143         } catch (PGPException pgpe) {
+144             throw new BuildException(pgpe);
+145         }
+146         if (artefact != null) {
+147             dosign(keyRing, artefact);
+148         }
+149         if (tosign.size() != 0) {
+150             for (FileSet fileset : tosign) {
+151                 dosign(keyRing, fileset);
+152             }
+153         }
+154         FileUtils.close(secStream);
+155         FileUtils.close(pubStream);
+156     }
+157     private void dosign(KeyRing keyRing, FileSet fs) {
+158         DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+159         String[] artefacts = ds.getIncludedFiles();
+160         for (String artefact : artefacts) {
+161             dosign(keyRing, new File(fs.getDir(getProject()), artefact), fs.getDir(getProject()), artefact);
+162         }
+163     }
+164     private void dosign(KeyRing keyRing, File oneartefact) {
+165         dosign(keyRing, oneartefact, oneartefact.getParentFile(), oneartefact.getName());
+166     }
+167     private void dosign(KeyRing keyRing, File oneartefact, File basedir, String relpath) {
+168         FileInputStream fis = null;
+169         FileOutputStream fos = null;
+170         File signature;
+171 
+172         try {
+173             fis = new FileInputStream(oneartefact);
+174             FileNameMapper mapper = getMapper();
+175             String [] mappedFiles = mapper.mapFileName(relpath);
+176             if (mappedFiles == null || mappedFiles.length != 1) {
+177                 throw new BuildException("mapper returned more or less than one output");
+178             }
+179             signature = new File(basedir, mappedFiles[0]);
+180             fos = new FileOutputStream(signature);
+181             OpenPgpSigner signer = new BouncyCastleOpenPgpSigner();
+182             signer.detachedSign(fis, fos, keyId, keyRing, asciiarmor);
+183         } catch (FileNotFoundException fnfe) {
+184             throw new BuildException(fnfe);
+185         } catch (IOException ioe) {
+186             throw new BuildException(ioe);
+187         } catch (OpenPgpException opgpe) {
+188             throw new BuildException(opgpe);
+189         }
+190         FileUtils.close(fos);
+191         FileUtils.close(fis);
+192 
+193     }
+194     /**
+195      * returns the mapper to use based on nested elements or the
+196      */
+197     private FileNameMapper getMapper() {
+198         FileNameMapper mapper = null;
+199         if (mapperElement != null) {
+200             mapper = mapperElement.getImplementation();
+201         } else {
+202             mapper = new GlobPatternMapper();
+203             mapper.setFrom("*");
+204             if (asciiarmor) {
+205                 mapper.setTo("*.asc");
+206             } else {
+207                 mapper.setTo("*.sig");
+208             }
+209         }
+210         return mapper;
+211     }
+212 
+213 }
+
+
+