org.apache.commons.ssl

## Class KeyMaterial

- java.lang.Object
- - org.apache.commons.ssl.TrustChain
  - - org.apache.commons.ssl.TrustMaterial
    - - org.apache.commons.ssl.KeyMaterial

    public class KeyMaterial
    extends TrustMaterial

Since:
  27-Feb-2006
Author:
  Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com

### Field Summary

Fields
`private java.util.List` `aliases`
`private java.util.List` `associatedChains`
`private java.lang.Object` `keyManagerFactory`

### Fields inherited from class org.apache.commons.ssl.TrustMaterial

`CACERTS, DEFAULT, JSSE_CACERTS, SIMPLE_TRUST_TYPE_TRUST_ALL, SIMPLE_TRUST_TYPE_TRUST_THIS_JVM, simpleTrustType, TRUST_ALL, TRUST_THIS_JVM`

### Constructor Summary

Constructors
Constructor and Description
`KeyMaterial(byte[] jksOrCerts, byte[] key, char[] password)`
`KeyMaterial(byte[] jksOrCerts, byte[] key, char[] jksPass, char[] keyPass)`
`KeyMaterial(byte[] jks, char[] password)`
`KeyMaterial(byte[] jks, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.io.File jksFile, char[] password)`
`KeyMaterial(java.io.File jksFile, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.io.File certsFile, java.io.File keyFile, char[] password)`
`KeyMaterial(java.io.File certsFile, java.io.File keyFile, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.io.InputStream jks, char[] password)`
`KeyMaterial(java.io.InputStream jks, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.io.InputStream jks, java.io.InputStream key, char[] password)`
`KeyMaterial(java.io.InputStream jks, java.io.InputStream key, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.lang.String pathToJksFile, char[] password)`
`KeyMaterial(java.lang.String pathToJksFile, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.lang.String pathToCerts, java.lang.String pathToKey, char[] password)`
`KeyMaterial(java.lang.String pathToCerts, java.lang.String pathToKey, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.net.URL urlToJKS, char[] password)`
`KeyMaterial(java.net.URL urlToJKS, char[] jksPass, char[] keyPass)`
`KeyMaterial(java.net.URL urlToCerts, java.net.URL urlToKey, char[] password)`
`KeyMaterial(java.net.URL urlToCerts, java.net.URL urlToKey, char[] jksPass, char[] keyPass)`

### Method Summary

Methods
`java.util.List` `getAliases()`
`java.util.List` `getAssociatedCertificateChains()`
`java.lang.Object[]` `getKeyManagers()`
`java.security.KeyStore` `getKeyStore()`
`static void` `main(java.lang.String[] args)`
`java.lang.String` `toString()`

### Methods inherited from class org.apache.commons.ssl.TrustMaterial

`containsTrustAll`

### Methods inherited from class org.apache.commons.ssl.TrustChain

`addTrustMaterial, contains, contains, getCertificates, getSize, getTrustManagerFactory, getTrustManagers, getUnifiedKeyStore, isEmpty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### keyManagerFactory

    private final java.lang.Object keyManagerFactory

#### aliases

    private final java.util.List aliases

#### associatedChains

    private final java.util.List associatedChains

### Constructor Detail

#### KeyMaterial

    public KeyMaterial(java.io.InputStream jks,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.InputStream jks,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.InputStream jks,
               java.io.InputStream key,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.InputStream jks,
               java.io.InputStream key,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.lang.String pathToJksFile,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.lang.String pathToJksFile,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.lang.String pathToCerts,
               java.lang.String pathToKey,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.lang.String pathToCerts,
               java.lang.String pathToKey,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.File jksFile,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.File jksFile,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.File certsFile,
               java.io.File keyFile,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.io.File certsFile,
               java.io.File keyFile,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.net.URL urlToJKS,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.net.URL urlToJKS,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.net.URL urlToCerts,
               java.net.URL urlToKey,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(java.net.URL urlToCerts,
               java.net.URL urlToKey,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(byte[] jks,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(byte[] jks,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(byte[] jksOrCerts,
               byte[] key,
               char[] password)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

#### KeyMaterial

    public KeyMaterial(byte[] jksOrCerts,
               byte[] key,
               char[] jksPass,
               char[] keyPass)
                throws java.security.GeneralSecurityException,
                       java.io.IOException

Throws:
  `java.security.GeneralSecurityException`
  `java.io.IOException`

### Method Detail

#### getKeyManagers

    public java.lang.Object[] getKeyManagers()

#### getAssociatedCertificateChains

    public java.util.List getAssociatedCertificateChains()

#### getKeyStore

    public java.security.KeyStore getKeyStore()

Overrides:
  `getKeyStore` in class `TrustMaterial`

#### getAliases

    public java.util.List getAliases()

#### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

Throws:
  `java.lang.Exception`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`