Example usage for org.apache.commons.ssl KeyStoreBuilder build

List of usage examples for org.apache.commons.ssl KeyStoreBuilder build

Introduction

In this page you can find the example usage for org.apache.commons.ssl KeyStoreBuilder build.

Prototype

public static KeyStore build(byte[] jksOrCerts, byte[] privateKey, char[] jksPassword, char[] keyPassword)
            throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException,
            InvalidKeyException, NoSuchProviderException, ProbablyBadPasswordException, UnrecoverableKeyException 

Source Link

Usage

From source file:com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto.java

@javax.annotation.Nullable
@Deprecated//from   ww w .jav a  2 s  .  c o  m
private KeyStore fallbackLoad() throws IOException, CertificateException, KeyStoreException,
        NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, ProbablyBadPasswordException,
        UnrecoverableKeyException, FileNotFoundException {
    KeyStore fallbackKeystore = null;
    if (StringUtils.hasContent(getDefaultAlias()) && StringUtils.hasContent(getAliasPassword())) {
        fallbackKeystore = KeyStoreBuilder.build(
                Util.streamToBytes(new FileInputStream(sourceProperty.expand())), getDefaultAlias().getBytes(),
                getPassword().toCharArray(), getAliasPassword().toCharArray());
    } else
        fallbackKeystore = KeyStoreBuilder.build(
                Util.streamToBytes(new FileInputStream(sourceProperty.expand())),
                StringUtils.hasContent(getPassword()) ? getPassword().toCharArray() : null);
    return fallbackKeystore;
}