// Path: crypto-java/src/main/java/de/dominikschadow/javasecurity/asymmetric/DSA.java
// public class DSA {
//     private static final String ALGORITHM = "SHA1withDSA";
// 
//     public byte[] sign(PrivateKey privateKey, String initialText) throws NoSuchAlgorithmException,
//             InvalidKeyException, SignatureException {
//         Signature dsa = Signature.getInstance(ALGORITHM);
//         dsa.initSign(privateKey);
//         dsa.update(initialText.getBytes(StandardCharsets.UTF_8));
//         return dsa.sign();
//     }
// 
//     public boolean verify(PublicKey publicKey, byte[] signature, String initialText) throws
//             NoSuchAlgorithmException, InvalidKeyException, SignatureException {
//         Signature dsa = Signature.getInstance(ALGORITHM);
//         dsa.initVerify(publicKey);
//         dsa.update(initialText.getBytes(StandardCharsets.UTF_8));
//         return dsa.verify(signature);
//     }
// }


import de.dominikschadow.javasecurity.asymmetric.DSA;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;
package de.dominikschadow.javasecurity;



public class Keystore {
    private static final String KEYSTORE_PATH = "/samples.ks";

    public static KeyStore loadKeystore(char[] keystorePassword) throws KeyStoreException,
            CertificateException, NoSuchAlgorithmException, IOException {
// Path: crypto-java/src/main/java/de/dominikschadow/javasecurity/asymmetric/DSA.java
// public class DSA {
//     private static final String ALGORITHM = "SHA1withDSA";
// 
//     public byte[] sign(PrivateKey privateKey, String initialText) throws NoSuchAlgorithmException,
//             InvalidKeyException, SignatureException {
//         Signature dsa = Signature.getInstance(ALGORITHM);
//         dsa.initSign(privateKey);
//         dsa.update(initialText.getBytes(StandardCharsets.UTF_8));
//         return dsa.sign();
//     }
// 
//     public boolean verify(PublicKey publicKey, byte[] signature, String initialText) throws
//             NoSuchAlgorithmException, InvalidKeyException, SignatureException {
//         Signature dsa = Signature.getInstance(ALGORITHM);
//         dsa.initVerify(publicKey);
//         dsa.update(initialText.getBytes(StandardCharsets.UTF_8));
//         return dsa.verify(signature);
//     }
// }


// Path: crypto-java/src/main/java/de/dominikschadow/javasecurity/Keystore.java
import de.dominikschadow.javasecurity.asymmetric.DSA;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.io.InputStream;
import java.security.*;
import java.security.cert.CertificateException;

package de.dominikschadow.javasecurity;



public class Keystore {
    private static final String KEYSTORE_PATH = "/samples.ks";

    public static KeyStore loadKeystore(char[] keystorePassword) throws KeyStoreException,
            CertificateException, NoSuchAlgorithmException, IOException {
        try (InputStream keystoreStream = DSA.class.getResourceAsStream(KEYSTORE_PATH)) {