Author: toad
Date: 2009-03-07 20:30:00 +0000 (Sat, 07 Mar 2009)
New Revision: 25946

Modified:
   branches/db4o/freenet/src/freenet/keys/USK.java
Log:
USK clone


Modified: branches/db4o/freenet/src/freenet/keys/USK.java
===================================================================
--- branches/db4o/freenet/src/freenet/keys/USK.java     2009-03-07 19:54:20 UTC 
(rev 25945)
+++ branches/db4o/freenet/src/freenet/keys/USK.java     2009-03-07 20:30:00 UTC 
(rev 25946)
@@ -87,6 +87,16 @@
                        siteName.hashCode() ^ (int)suggestedEdition ^ 
(int)(suggestedEdition >> 32);
        }
 
+       public USK(USK usk) {
+               this.pubKeyHash = usk.pubKeyHash;
+               this.cryptoAlgorithm = usk.cryptoAlgorithm;
+               this.cryptoKey = usk.cryptoKey;
+               this.siteName = usk.siteName;
+               this.suggestedEdition = usk.suggestedEdition;
+               hashCode = Fields.hashCode(pubKeyHash) ^ 
Fields.hashCode(cryptoKey) ^
+                       siteName.hashCode() ^ (int)suggestedEdition ^ 
(int)(suggestedEdition >> 32);
+       }
+
        @Override
        public FreenetURI getURI() {
                return new FreenetURI(pubKeyHash, cryptoKey, 
ClientSSK.getExtraBytes(cryptoAlgorithm), siteName, suggestedEdition);
@@ -114,6 +124,10 @@
                return copy(0);
        }
        
+       public USK clone() {
+               return new USK(this);
+       }
+       
        @Override
        public boolean equals(Object o) {
                if(o == null || !(o instanceof USK)) return false;

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to