-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a direct result of #4
- Loading branch information
Showing
5 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
app/src/androidTest/java/com/goterl/lazycode/lazysodium/LoadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) Terl Tech Ltd • 23/05/18 13:30 • goterl.com | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v2.0. If a copy of the MPL was not distributed with this | ||
* file, you can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package com.goterl.lazycode.lazysodium; | ||
|
||
import android.support.test.runner.AndroidJUnit4; | ||
import junit.framework.TestCase; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class LoadTest { | ||
|
||
@Test | ||
public void loadsCorrectly() { | ||
SodiumAndroid sodiumAndroid = new SodiumAndroid(); | ||
TestCase.assertTrue(true); | ||
} | ||
|
||
@Test | ||
public void keygen() { | ||
SodiumAndroid sodiumAndroid = new SodiumAndroid(); | ||
LazySodiumAndroid lazySodium = new LazySodiumAndroid(sodiumAndroid); | ||
|
||
String key = lazySodium.cryptoAuthKeygen(); | ||
|
||
TestCase.assertNotNull(key); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/goterl/lazycode/lazysodium/LazySodiumAndroid.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) Terl Tech Ltd • 23/05/18 16:24 • goterl.com | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v2.0. If a copy of the MPL was not distributed with this | ||
* file, you can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package com.goterl.lazycode.lazysodium; | ||
|
||
import java.nio.charset.Charset; | ||
|
||
public class LazySodiumAndroid extends LazySodium { | ||
|
||
|
||
private final SodiumAndroid sodium; | ||
|
||
|
||
public LazySodiumAndroid(SodiumAndroid sodium) { | ||
this.sodium = sodium; | ||
} | ||
|
||
public LazySodiumAndroid(SodiumAndroid sodium, Charset charset) { | ||
super(charset); | ||
this.sodium = sodium; | ||
} | ||
|
||
public SodiumAndroid getSodium() { | ||
return sodium; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule lazysodium-java
updated
11 files