Package com.browserup.bup.mitm
Class KeyStoreFileCertificateSource
- java.lang.Object
-
- com.browserup.bup.mitm.KeyStoreFileCertificateSource
-
- All Implemented Interfaces:
CertificateAndKeySource
public class KeyStoreFileCertificateSource extends java.lang.Object implements CertificateAndKeySource
Loads a KeyStore from a file or classpath resource. If configured with a File object, attempts to load the KeyStore from the specified file. Otherwise, attempts to load the KeyStore from a classpath resource.
-
-
Constructor Summary
Constructors Constructor Description KeyStoreFileCertificateSource(java.lang.String keyStoreType, java.io.File keyStoreFile, java.lang.String privateKeyAlias, java.lang.String keyStorePassword)Creates aCertificateAndKeySourcethat loads an existingKeyStorefrom a classpath resource.KeyStoreFileCertificateSource(java.lang.String keyStoreType, java.lang.String keyStoreClasspathResource, java.lang.String privateKeyAlias, java.lang.String keyStorePassword)Creates aCertificateAndKeySourcethat loads an existingKeyStorefrom a classpath resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyStoreFileCertificateSourcecertificateTool(SecurityProviderTool securityProviderTool)Override the defaultSecurityProviderToolused to load the KeyStore.CertificateAndKeyload()Loads a certificate and its corresponding private key.
-
-
-
Constructor Detail
-
KeyStoreFileCertificateSource
public KeyStoreFileCertificateSource(java.lang.String keyStoreType, java.lang.String keyStoreClasspathResource, java.lang.String privateKeyAlias, java.lang.String keyStorePassword)Creates aCertificateAndKeySourcethat loads an existingKeyStorefrom a classpath resource.- Parameters:
keyStoreType- the KeyStore type, such as PKCS12 or JKSkeyStoreClasspathResource- classpath resource to load (for example, "/keystore.jks")privateKeyAlias- the alias of the private key in the KeyStorekeyStorePassword- te KeyStore password
-
KeyStoreFileCertificateSource
public KeyStoreFileCertificateSource(java.lang.String keyStoreType, java.io.File keyStoreFile, java.lang.String privateKeyAlias, java.lang.String keyStorePassword)Creates aCertificateAndKeySourcethat loads an existingKeyStorefrom a classpath resource.- Parameters:
keyStoreType- the KeyStore type, such as PKCS12 or JKSkeyStoreFile- KeyStore file to loadprivateKeyAlias- the alias of the private key in the KeyStorekeyStorePassword- te KeyStore password
-
-
Method Detail
-
certificateTool
public KeyStoreFileCertificateSource certificateTool(SecurityProviderTool securityProviderTool)
Override the defaultSecurityProviderToolused to load the KeyStore.- Parameters:
securityProviderTool- securityProviderTool- Returns:
- KeyStoreFileCertificateSource
-
load
public CertificateAndKey load()
Description copied from interface:CertificateAndKeySourceLoads a certificate and its corresponding private key. Every time this method is called, it should return the same certificate and private key (although it may be a differentCertificateAndKeyinstance).- Specified by:
loadin interfaceCertificateAndKeySource- Returns:
- certificate and its corresponding private key
-
-