-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from carlonzo/hawk-internal
Created HawkInternal
- Loading branch information
Showing
10 changed files
with
122 additions
and
76 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
hawk/src/main/java/com/orhanobut/hawk/Base64Encryption.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,22 @@ | ||
package com.orhanobut.hawk; | ||
|
||
/** | ||
* Provides Base64 Algorithm | ||
*/ | ||
public class Base64Encryption implements Encryption { | ||
@Override public boolean init() { | ||
return true; | ||
} | ||
|
||
@Override public String encrypt(byte[] value) { | ||
return DataHelper.encodeBase64(value); | ||
} | ||
|
||
@Override public byte[] decrypt(String value) { | ||
return DataHelper.decodeBase64(value); | ||
} | ||
|
||
@Override public boolean reset() { | ||
return true; | ||
} | ||
} |
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
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
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
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,33 @@ | ||
package com.orhanobut.hawk; | ||
|
||
public class HawkInternal { | ||
|
||
private Storage cryptoStorage; | ||
private Encoder encoder; | ||
private Encryption encryption; | ||
private LogLevel logLevel; | ||
|
||
HawkInternal(HawkBuilder hawkBuilder) { | ||
cryptoStorage = hawkBuilder.getStorage(); | ||
encoder = hawkBuilder.getEncoder(); | ||
encryption = hawkBuilder.getEncryption(); | ||
logLevel = hawkBuilder.getLogLevel(); | ||
} | ||
|
||
Storage getStorage() { | ||
return cryptoStorage; | ||
} | ||
|
||
Encoder getEncoder() { | ||
return encoder; | ||
} | ||
|
||
Encryption getEncryption() { | ||
return encryption; | ||
} | ||
|
||
LogLevel getLogLevel() { | ||
return logLevel; | ||
} | ||
|
||
} |
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
Oops, something went wrong.