gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r32477 - gnunet-java/src/main/java/org/gnunet/util/crypto


From: gnunet
Subject: [GNUnet-SVN] r32477 - gnunet-java/src/main/java/org/gnunet/util/crypto
Date: Tue, 25 Feb 2014 12:15:59 +0100

Author: dold
Date: 2014-02-25 12:15:59 +0100 (Tue, 25 Feb 2014)
New Revision: 32477

Removed:
   gnunet-java/src/main/java/org/gnunet/util/crypto/EddsaSignedMessage.java
Log:
- the design of EddsaSignedMessage is disfunctional, remove it


Deleted: 
gnunet-java/src/main/java/org/gnunet/util/crypto/EddsaSignedMessage.java
===================================================================
--- gnunet-java/src/main/java/org/gnunet/util/crypto/EddsaSignedMessage.java    
2014-02-25 11:15:15 UTC (rev 32476)
+++ gnunet-java/src/main/java/org/gnunet/util/crypto/EddsaSignedMessage.java    
2014-02-25 11:15:59 UTC (rev 32477)
@@ -1,60 +0,0 @@
-/*
- This file is part of GNUnet.
-  (C) 2012, 2013 Christian Grothoff (and other contributing authors)
-
-  GNUnet is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published
-  by the Free Software Foundation; either version 3, or (at your
-  option) any later version.
-
-  GNUnet is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with GNUnet; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-  Boston, MA 02111-1307, USA.
- */
-
-package org.gnunet.util.crypto;
-
-import org.gnunet.construct.Construct;
-import org.gnunet.construct.Message;
-import org.gnunet.construct.NestedMessage;
-import org.gnunet.construct.UInt32;
-
-/**
- * A message together with a signature on the message and it's purpose.
- */
-public class EddsaSignedMessage<M extends Message> implements Message {
-    @NestedMessage
-    public EddsaSignature signature;
-    @UInt32
-    public int purpose;
-    @NestedMessage
-    public M innerMessage;
-
-    public EddsaSignedMessage() {
-        // empty constructor required by org.gnunet.construct
-    }
-
-    public boolean verify(EddsaPublicKey signerPublicKey) {
-        return signature.verify(Construct.toBinary(innerMessage), purpose, 
signerPublicKey);
-    }
-
-    public static <T extends Message> EddsaSignedMessage<T> signMessage(T 
innerMessage, int purpose,
-                                             EddsaPrivateKey privateKey, 
EddsaPublicKey publicKey) {
-        EddsaSignedMessage<T> esm = new EddsaSignedMessage<T>();
-        esm.purpose = purpose;
-        esm.innerMessage = innerMessage;
-        esm.signature = privateKey.sign(publicKey, purpose, 
Construct.toBinary(innerMessage));
-        return esm;
-    }
-
-    public static <T extends Message> EddsaSignedMessage<T> signMessage(T 
innerMessage, int purpose,
-                                             EddsaPrivateKey privateKey) {
-        return signMessage(innerMessage, purpose, privateKey, 
privateKey.getPublicKey());
-    }
-}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]