// Path: keystore-service/src/main/java/com/stnetix/ariaddna/keystore/exceptions/KeyStoreException.java
// public class KeyStoreException extends AriaddnaException {
//     public KeyStoreException(Throwable cause) {
//         super(cause);
//     }
// 
//     public KeyStoreException(String traceMessage) {
//         super(traceMessage);
//     }
// 
//     public KeyStoreException(String traceMessage, String errorMessage) {
//         super(traceMessage, errorMessage);
//     }
// 
//     public KeyStoreException(String traceMessage, Throwable cause) {
//         super(traceMessage, cause);
//     }
// 
//     public KeyStoreException(String traceMessage, String errorMessage, Throwable cause) {
//         super(traceMessage, errorMessage, cause);
//     }
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import sun.security.x509.X509CertImpl;
import com.stnetix.ariaddna.commonutils.logger.AriaddnaLogger;
import com.stnetix.ariaddna.keystore.exceptions.KeyStoreException;
/*
 * Copyright (c) 2018 stnetix.com. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.  You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, without warranties or
 * conditions of any kind, EITHER EXPRESS OR IMPLIED.  See the License for the
 * specific language governing permissions and limitations under the License.
 */

package com.stnetix.ariaddna.keystore.utils;




/**
 * Created by alexkotov on 20.04.17.
 */

public class KeyFactory {

    public KeyFactory(IPersistHelper persistHelper, CertFactory certFactory) {
        this.persistHelper = persistHelper;
        this.certFactory = certFactory;
        pass = this.persistHelper.getPassword();
    }

    private IPersistHelper persistHelper;
    private CertFactory certFactory;
    private static final String KEYSTORE_PATH;
    private char[] pass;
    private static final AriaddnaLogger LOGGER;
    private static final String KEYSTORE_FORMAT;

    static {

        KEYSTORE_PATH = "ariaddna.keystore";
        LOGGER = AriaddnaLogger.getLogger(KeyFactory.class);
        KEYSTORE_FORMAT = "JKS";
    }

// Path: keystore-service/src/main/java/com/stnetix/ariaddna/keystore/exceptions/KeyStoreException.java
// public class KeyStoreException extends AriaddnaException {
//     public KeyStoreException(Throwable cause) {
//         super(cause);
//     }
// 
//     public KeyStoreException(String traceMessage) {
//         super(traceMessage);
//     }
// 
//     public KeyStoreException(String traceMessage, String errorMessage) {
//         super(traceMessage, errorMessage);
//     }
// 
//     public KeyStoreException(String traceMessage, Throwable cause) {
//         super(traceMessage, cause);
//     }
// 
//     public KeyStoreException(String traceMessage, String errorMessage, Throwable cause) {
//         super(traceMessage, errorMessage, cause);
//     }
// }


// Path: keystore-service/src/main/java/com/stnetix/ariaddna/keystore/utils/KeyFactory.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import sun.security.x509.X509CertImpl;
import com.stnetix.ariaddna.commonutils.logger.AriaddnaLogger;
import com.stnetix.ariaddna.keystore.exceptions.KeyStoreException;

/*
 * Copyright (c) 2018 stnetix.com. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.  You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, without warranties or
 * conditions of any kind, EITHER EXPRESS OR IMPLIED.  See the License for the
 * specific language governing permissions and limitations under the License.
 */

package com.stnetix.ariaddna.keystore.utils;




/**
 * Created by alexkotov on 20.04.17.
 */

public class KeyFactory {

    public KeyFactory(IPersistHelper persistHelper, CertFactory certFactory) {
        this.persistHelper = persistHelper;
        this.certFactory = certFactory;
        pass = this.persistHelper.getPassword();
    }

    private IPersistHelper persistHelper;
    private CertFactory certFactory;
    private static final String KEYSTORE_PATH;
    private char[] pass;
    private static final AriaddnaLogger LOGGER;
    private static final String KEYSTORE_FORMAT;

    static {

        KEYSTORE_PATH = "ariaddna.keystore";
        LOGGER = AriaddnaLogger.getLogger(KeyFactory.class);
        KEYSTORE_FORMAT = "JKS";
    }

    public File getNewKeyStore() throws KeyStoreException {