## org.beepcore.beep.profile.tls.ptls
Class TLSProfilePureTLSPemInit

    java.lang.Object
      org.beepcore.beep.core.TuningProfile
          org.beepcore.beep.profile.tls.TLSProfile
              org.beepcore.beep.profile.tls.ptls.TLSProfilePureTLSPemInit

All Implemented Interfaces:
  Profile

public class TLSProfilePureTLSPemInit
extends TLSProfile

An initialiser class that takes a specific initialisation sequence and creates a TLSProfilePureTLS and returns it. This one takes as parameters file names for PEM files (base64 encoded files with BEGIN/END delimiters). An initialiser class for TLS is one that takes the necessary data, a private key, certificate chain, and trusted certificates, in a certain format and translates them to their raw formats and initialises a TLSProfilePureTLS instance with them. `TLSProfilePureTLS` is designed to be flexible and not require any specific configuration to encrypt a session with TLS.

Field Summary
`static String` `PROPERTY_CERTIFICATES`
`static String` `PROPERTY_CIPHER_SUITE`
`static String` `PROPERTY_CLIENT_AUTH_REQUIRED`
`static String` `PROPERTY_PRIVATE_KEY`
`static String` `PROPERTY_PRIVATE_KEY_PASSPHRASE`
`static String` `PROPERTY_PRIVATE_KEY_TYPE`
`static String` `PROPERTY_TRUSTED_CERTS`

Fields inherited from class org.beepcore.beep.profile.tls.TLSProfile
`URI`

Constructor Summary
`TLSProfilePureTLSPemInit()` Default constructor

Method Summary
`StartChannelListener` `init(String uri, ProfileConfiguration config)` init sets the criteria for which an TLS connection is made when a TLS channel is started for a profile.
`TCPSession` `startTLS(TCPSession session)`

Methods inherited from class org.beepcore.beep.profile.tls.TLSProfile
`getDefaultInstance, getInstance`

Methods inherited from class org.beepcore.beep.core.TuningProfile
`abort, begin, begin, complete, disableIO, enableIO, reset, sendProfile, setLocalCredential, setPeerCredential, startChannel`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PROPERTY_CLIENT_AUTH_REQUIRED

    public static final String PROPERTY_CLIENT_AUTH_REQUIRED

See Also:
  `init(java.lang.String, org.beepcore.beep.profile.ProfileConfiguration)`, Constant Field Values

### PROPERTY_CIPHER_SUITE

    public static final String PROPERTY_CIPHER_SUITE

See Also:
  Constant Field Values

### PROPERTY_CERTIFICATES

    public static final String PROPERTY_CERTIFICATES

See Also:
  Constant Field Values

### PROPERTY_PRIVATE_KEY

    public static final String PROPERTY_PRIVATE_KEY

See Also:
  Constant Field Values

### PROPERTY_PRIVATE_KEY_PASSPHRASE

    public static final String PROPERTY_PRIVATE_KEY_PASSPHRASE

See Also:
  Constant Field Values

### PROPERTY_PRIVATE_KEY_TYPE

    public static final String PROPERTY_PRIVATE_KEY_TYPE

See Also:
  Constant Field Values

### PROPERTY_TRUSTED_CERTS

    public static final String PROPERTY_TRUSTED_CERTS

See Also:
  Constant Field Values

Constructor Detail

### TLSProfilePureTLSPemInit

    public TLSProfilePureTLSPemInit()

  Default constructor

Method Detail

### init

    public StartChannelListener init(String uri,
                                     ProfileConfiguration config)
                              throws BEEPException

  init sets the criteria for which an TLS connection is made when a TLS channel is started for a profile. It should only be called once. For the properties, the initiator is defined as the peer who starts the channel for the TLS profile, the listener is the peer that receives the the channel start request, irregardless of which actually started the session.

  Parameters:
    `uri` - used to start a channel with TLS protection
    `config` - used to specify the parameters for sessions protected by this profile's version of TLS. In other words, if you want another set of paramters, you must either recall this method or create another `TLSProfilePureTLSPemInit` and call this method with a new configuration. Note: All different parameters may be in the same PEM file. The meaningful properties that can be set are:

    Cipher Suite | List of cipher names (comma separated) to accept. Cipher names are formatted as per Appendix A in the TLS spec. By default all the ciphers (except anonymous for now) are available. Use this to restrict to a certain strength of cipher if you desire to do so.
    Certificates | Name of the PEM file that contains the certificates to present. These are in order from the user's certificate to the root certificate.
    Private Key | Name of the PEM file that contains the encrypted private key to use.
    Private Key Passphrase | `String` passphrase used to encrypt the private key in its file.
    Private Key Type | "RSA" or "DSA" are the two accepted private key formats.
    Trusted Certificates | Name of the PEM file that contains the root certificates used to verify a peer's identity.

  Throws:
    `BEEPException`

### startTLS

    public TCPSession startTLS(TCPSession session)
                        throws BEEPException

  Throws:
    `BEEPException`

Copyright ? 2001 Invisible Worlds, Inc. All Rights Reserved.