incubator-amber-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r963075 - in /incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa: AbstractRsaSha1Key.java PemRsaSha1SigningKey.java PemRsaSha1VeifyingKey.java
Date Sun, 11 Jul 2010 14:03:14 GMT
Author: simonetripodi
Date: Sun Jul 11 14:03:14 2010
New Revision: 963075

URL: http://svn.apache.org/viewvc?rev=963075&view=rev
Log:
at some point, the type is needed...

Modified:
    incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/AbstractRsaSha1Key.java
    incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1SigningKey.java
    incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1VeifyingKey.java

Modified: incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/AbstractRsaSha1Key.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/AbstractRsaSha1Key.java?rev=963075&r1=963074&r2=963075&view=diff
==============================================================================
--- incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/AbstractRsaSha1Key.java
(original)
+++ incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/AbstractRsaSha1Key.java
Sun Jul 11 14:03:14 2010
@@ -31,11 +31,11 @@ import org.apache.amber.signature.Signat
  *
  * @version $Id$
  */
-abstract class AbstractRsaSha1Key implements org.apache.amber.signature.Key {
+abstract class AbstractRsaSha1Key<T extends java.security.Key> implements org.apache.amber.signature.Key
{
 
     private static final String[] METHODS = { "RSA-SHA1" };
 
-    private final java.security.Key keyValue;
+    private final T keyValue;
 
     /**
      * Loads a key from a certificate located in the classpath.
@@ -104,7 +104,7 @@ abstract class AbstractRsaSha1Key implem
         this.keyValue = this.readCertificate(certificateURL);
     }
 
-    private java.security.Key readCertificate(URL certificateURL) throws SignatureException
{
+    private T readCertificate(URL certificateURL) throws SignatureException {
         URLConnection urlConnection = null;
         InputStream input = null;
 
@@ -132,7 +132,7 @@ abstract class AbstractRsaSha1Key implem
         }
     }
 
-    public java.security.Key getKeyValue() {
+    public T getKeyValue() {
         return this.keyValue;
     }
 
@@ -141,7 +141,7 @@ abstract class AbstractRsaSha1Key implem
         return String.valueOf(this.keyValue);
     }
 
-    protected abstract java.security.Key readCertificate(InputStream input) throws Exception;
+    protected abstract T readCertificate(InputStream input) throws Exception;
 
     /**
      * {@inheritDoc}

Modified: incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1SigningKey.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1SigningKey.java?rev=963075&r1=963074&r2=963075&view=diff
==============================================================================
--- incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1SigningKey.java
(original)
+++ incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1SigningKey.java
Sun Jul 11 14:03:14 2010
@@ -19,7 +19,7 @@ package org.apache.amber.signature.rsa;
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
-import java.security.Key;
+import java.security.interfaces.RSAPrivateKey;
 
 import org.apache.amber.signature.SignatureException;
 import org.apache.amber.signature.SigningKey;
@@ -30,7 +30,7 @@ import org.apache.amber.signature.Signin
  * @version $Id$
  */
 public final class PemRsaSha1SigningKey
-        extends AbstractRsaSha1Key
+        extends AbstractRsaSha1Key<RSAPrivateKey>
         implements SigningKey {
 
     public PemRsaSha1SigningKey(File certificateFileLocation)
@@ -51,7 +51,7 @@ public final class PemRsaSha1SigningKey
      * {@inheritDoc}
      */
     @Override
-    protected Key readCertificate(InputStream input) throws Exception {
+    protected RSAPrivateKey readCertificate(InputStream input) throws Exception {
         PemCertificateParser pemCertificateParser = new PemCertificateParser(input);
         return pemCertificateParser.parsePrivateKey();
     }

Modified: incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1VeifyingKey.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1VeifyingKey.java?rev=963075&r1=963074&r2=963075&view=diff
==============================================================================
--- incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1VeifyingKey.java
(original)
+++ incubator/amber/trunk/signature-api/src/main/java/org/apache/amber/signature/rsa/PemRsaSha1VeifyingKey.java
Sun Jul 11 14:03:14 2010
@@ -19,7 +19,7 @@ package org.apache.amber.signature.rsa;
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
-import java.security.Key;
+import java.security.interfaces.RSAPublicKey;
 
 import org.apache.amber.signature.SignatureException;
 import org.apache.amber.signature.SigningKey;
@@ -30,7 +30,7 @@ import org.apache.amber.signature.Signin
  * @version $Id$
  */
 public final class PemRsaSha1VeifyingKey
-        extends AbstractRsaSha1Key
+        extends AbstractRsaSha1Key<RSAPublicKey>
         implements SigningKey {
 
     public PemRsaSha1VeifyingKey(File certificateFileLocation)
@@ -51,7 +51,7 @@ public final class PemRsaSha1VeifyingKey
      * {@inheritDoc}
      */
     @Override
-    protected Key readCertificate(InputStream input) throws Exception {
+    protected RSAPublicKey readCertificate(InputStream input) throws Exception {
         PemCertificateParser pemCertificateParser = new PemCertificateParser(input);
         return pemCertificateParser.parsePublicCertificate();
     }



Mime
View raw message