From 1e543bafc1f7fa46bf6c2c9d46faa009dc127cb8 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 29 Jun 2015 22:34:47 +0200 Subject: [PATCH] name refactors --- src/nodash/core/NoConfigDefault.java | 2 +- src/nodash/core/spheres/NoByteSetSphere.java | 6 +++--- src/nodash/core/spheres/NoSessionSphere.java | 8 ++++---- src/nodash/models/NoUser.java | 6 +++--- src/nodash/test/NoUserTest.java | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nodash/core/NoConfigDefault.java b/src/nodash/core/NoConfigDefault.java index f327861..899f5d5 100644 --- a/src/nodash/core/NoConfigDefault.java +++ b/src/nodash/core/NoConfigDefault.java @@ -28,7 +28,7 @@ import java.nio.file.StandardOpenOption; import nodash.exceptions.NoDashFatalException; -public final class NoConfigDefault extends NoConfigBase implements Serializable { +public final class NoConfigDefault extends NoConfigBase implements NoConfigInterface, Serializable { private static final long serialVersionUID = -8498303909736017075L; private static final String CONFIG_FILENAME = "noconfig.cfg"; diff --git a/src/nodash/core/spheres/NoByteSetSphere.java b/src/nodash/core/spheres/NoByteSetSphere.java index 8f562c3..83bbd96 100644 --- a/src/nodash/core/spheres/NoByteSetSphere.java +++ b/src/nodash/core/spheres/NoByteSetSphere.java @@ -46,9 +46,9 @@ public final class NoByteSetSphere { } public static List consume(NoUser user) { - if (NoByteSetSphere.byteSets.containsKey(user.getRSAPublicKey())) { - ArrayList result = NoByteSetSphere.byteSets.get(user.getRSAPublicKey()); - NoByteSetSphere.byteSets.remove(user.getRSAPublicKey()); + if (NoByteSetSphere.byteSets.containsKey(user.getRsaPublicKey())) { + ArrayList result = NoByteSetSphere.byteSets.get(user.getRsaPublicKey()); + NoByteSetSphere.byteSets.remove(user.getRsaPublicKey()); return result; } else { return NoByteSetSphere.EMPTY_BYTESET_LIST; diff --git a/src/nodash/core/spheres/NoSessionSphere.java b/src/nodash/core/spheres/NoSessionSphere.java index 30c199b..df6f865 100644 --- a/src/nodash/core/spheres/NoSessionSphere.java +++ b/src/nodash/core/spheres/NoSessionSphere.java @@ -52,12 +52,12 @@ public final class NoSessionSphere { } } - public static void shred(byte[] encryptedUUID) { + public static void shred(byte[] encryptedUuid) { try { - UUID uuid = NoSession.decryptUuid(encryptedUUID); + UUID uuid = NoSession.decryptUuid(encryptedUuid); if (NoSessionSphere.sessions.containsKey(uuid)) { NoSession session = NoSessionSphere.sessions.get(uuid); - NoByteSetSphere.addList(session.incoming, session.current.getRSAPublicKey()); + NoByteSetSphere.addList(session.incoming, session.current.getRsaPublicKey()); NoSessionSphere.originalHashesOnline.remove(Base64.encodeBase64String(session .getOriginalHash())); NoSessionSphere.sessions.remove(uuid); @@ -74,7 +74,7 @@ public final class NoSessionSphere { session.check(); } catch (NoSessionExpiredException e) { /* Resultant from 3.1 and 3.2 */ - NoByteSetSphere.addList(session.incoming, session.current.getRSAPublicKey()); + NoByteSetSphere.addList(session.incoming, session.current.getRsaPublicKey()); NoSessionSphere.originalHashesOnline.remove(session.getOriginalHash()); NoSessionSphere.sessions.remove(uuid); session = null; diff --git a/src/nodash/models/NoUser.java b/src/nodash/models/NoUser.java index 5a523bc..5b46468 100644 --- a/src/nodash/models/NoUser.java +++ b/src/nodash/models/NoUser.java @@ -131,7 +131,7 @@ public class NoUser implements Serializable { public final void consume(NoByteSet byteSet) throws NoByteSetBadDecryptionException { try { - SecretKey secretKey = new SecretKeySpec(decryptRSA(byteSet.key), NoUtil.CIPHER_KEY_SPEC); + SecretKey secretKey = new SecretKeySpec(decryptRsa(byteSet.key), NoUtil.CIPHER_KEY_SPEC); byte[] key = secretKey.getEncoded(); secretKey = null; NoInfluence influence = NoInfluence.decrypt(byteSet.data, key); @@ -166,7 +166,7 @@ public class NoUser implements Serializable { return ((RSAPublicKeyImpl) publicKey).getModulus(); } - public final PublicKey getRSAPublicKey() { + public final PublicKey getRsaPublicKey() { try { return new RSAPublicKeyImpl(this.getModulus(), this.getPublicExponent()); } catch (InvalidKeyException e) { @@ -178,7 +178,7 @@ public class NoUser implements Serializable { return influences; } - private final byte[] decryptRSA(byte[] data) throws InvalidKeyException, + private final byte[] decryptRsa(byte[] data) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException { return NoUtil.decryptRsa(data, this.privateKey); } diff --git a/src/nodash/test/NoUserTest.java b/src/nodash/test/NoUserTest.java index 371a084..31f23a2 100644 --- a/src/nodash/test/NoUserTest.java +++ b/src/nodash/test/NoUserTest.java @@ -28,7 +28,7 @@ public class NoUserTest { assertNotNull(user.getNoActions()); assertEquals(user.getNoActions().size(), 0); - assertNotNull(user.getRSAPublicKey()); + assertNotNull(user.getRsaPublicKey()); assertNotNull(user.getPublicExponent()); assertNotNull(user.getModulus()); assertEquals(user.getInfluences(), 0);