com.android.builder.signing
Class KeystoreHelper

java.lang.Object
  extended by com.android.builder.signing.KeystoreHelper

public final class KeystoreHelper
extends java.lang.Object

A Helper to create and read keystore/keys.


Constructor Summary
KeystoreHelper()
           
 
Method Summary
static boolean createDebugStore(com.android.builder.model.SigningConfig signingConfig, com.android.utils.ILogger logger)
          Creates a new debug store with the location, keyalias, and passwords specified in the config.
static java.lang.String defaultDebugKeystoreLocation()
          Returns the location of the default debug keystore.
static CertificateInfo getCertificateInfo(com.android.builder.model.SigningConfig signingConfig)
          Returns the CertificateInfo for the given signing configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeystoreHelper

public KeystoreHelper()
Method Detail

defaultDebugKeystoreLocation

@NonNull
public static java.lang.String defaultDebugKeystoreLocation()
                                                     throws com.android.prefs.AndroidLocation.AndroidLocationException
Returns the location of the default debug keystore.

Returns:
The location of the default debug keystore.
Throws:
com.android.prefs.AndroidLocation.AndroidLocationException - if the location cannot be computed

createDebugStore

public static boolean createDebugStore(@NonNull
                                       com.android.builder.model.SigningConfig signingConfig,
                                       @NonNull
                                       com.android.utils.ILogger logger)
                                throws KeytoolException
Creates a new debug store with the location, keyalias, and passwords specified in the config.

Parameters:
signingConfig - The signing config
logger - a logger object to receive the log of the creation.
Throws:
KeytoolException

getCertificateInfo

public static CertificateInfo getCertificateInfo(@NonNull
                                                 com.android.builder.model.SigningConfig signingConfig)
                                          throws KeytoolException,
                                                 java.io.FileNotFoundException
Returns the CertificateInfo for the given signing configuration. Returns null if the key could not be found. If the passwords are wrong, it throws an exception

Parameters:
signingConfig - the signing configuration
Returns:
the certificate info if it could be loaded.
Throws:
KeytoolException
java.io.FileNotFoundException