mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-27 00:45:23 -04:00
added jars, fixed tests
This commit is contained in:
parent
3711519e3a
commit
c5ee2c9186
36 changed files with 341 additions and 258 deletions
|
@ -17,15 +17,10 @@
|
|||
|
||||
package io.bitsquare.common.crypto;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.PublicKey;
|
||||
|
||||
public final class DecryptedPayloadWithPubKey implements Serializable {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
|
||||
|
||||
public final Serializable payload;
|
||||
public final PublicKey sigPublicKey;
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ public class Encryption {
|
|||
return cipher.doFinal(encryptedPayload);
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException
|
||||
| BadPaddingException | IllegalBlockSizeException | NoSuchProviderException e) {
|
||||
e.printStackTrace();
|
||||
throw new CryptoException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.security.interfaces.DSAPrivateKey;
|
|||
import java.security.interfaces.RSAPrivateCrtKey;
|
||||
import java.security.spec.*;
|
||||
|
||||
// TODO: use a password protection for storage?
|
||||
// TODO: use a password protection for key storage
|
||||
public class KeyStorage {
|
||||
private static final Logger log = LoggerFactory.getLogger(KeyStorage.class);
|
||||
|
||||
|
@ -140,6 +140,7 @@ public class KeyStorage {
|
|||
if (!storageDir.exists())
|
||||
storageDir.mkdir();
|
||||
|
||||
|
||||
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(privateKey.getEncoded());
|
||||
try (FileOutputStream fos = new FileOutputStream(storageDir + "/" + name + ".key")) {
|
||||
fos.write(pkcs8EncodedKeySpec.getEncoded());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue