ActionScript 3 Cryptography Library | All Packages | All Classes | Index | Frames No Frames |
TLSEngine

Package | com.hurlant.crypto.tls
Class | public class TLSEngine
Inheritance | TLSEngine flash.events.EventDispatcher

The heart of the TLS protocol. This class can work in server or client mode. This doesn't fully implement the TLS protocol. Things missing that I'd like to add: - support for client-side certificates - general code clean-up to make sure we don't have gaping securite holes Things that aren't there that I won't add: - support for "export" cypher suites (deprecated in later TLS versions) - support for "anon" cypher suites (deprecated in later TLS versions) Things that I'm unsure about adding later: - compression. Compressing encrypted streams is barely worth the CPU cycles. - diffie-hellman based key exchange mechanisms. Nifty, but would we miss it?

Public Properties

| Property | Defined By
--- | --- | ---
|  | peerCertificate : X509Certificate [read-only] | TLSEngine
|  | protocol_version : uint | TLSEngine

Public Methods

| Method | Defined By
--- | --- | ---
|  | TLSEngine(config:TLSConfig, iStream:IDataInput, oStream:IDataOutput, otherIdentity:String = null) | TLSEngine
|  | acceptPeerCertificate():void | TLSEngine
|  | close(e:TLSError = null):void | TLSEngine
|  | dataAvailable(e:* = null):void | TLSEngine
|  | rejectPeerCertificate():void | TLSEngine
|  | sendApplicationData(data:ByteArray, offset:uint = 0, length:uint = 0):void | TLSEngine
|  | start():void This starts the TLS negotiation for a TLS Client. | TLSEngine

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | close |  | TLSEngine
|  | data |  | TLSEngine
|  | ready |  | TLSEngine
|  | socketData |  | TLSEngine

Public Constants

| Constant | Defined By
--- | --- | ---
|  | CLIENT : uint = 1 [static] | TLSEngine
|  | SERVER : uint = 0 [static] | TLSEngine

Property Detail

peerCertificate | property

`peerCertificate:X509Certificate` [read-only]

Implementation
`public function get peerCertificate():X509Certificate`

protocol_version | property |

`public var protocol_version:uint`

Constructor Detail

TLSEngine | () | Constructor

`public function TLSEngine(config:TLSConfig, iStream:IDataInput, oStream:IDataOutput, otherIdentity:String = null)`

Parameters

| `config:TLSConfig` — A TLSConfig instance describing how we're supposed to work
| `iStream:IDataInput` — An input stream to read TLS data from
| `oStream:IDataOutput` — An output stream to write TLS data to
| `otherIdentity:String` (default = `null`)`` — An optional identifier. If set, this will be checked against the Subject CN of the other side's certificate.

Method Detail

acceptPeerCertificate | () | method

`public function acceptPeerCertificate():void`

close | () | method |

`public function close(e:TLSError = null):void`

Parameters

| `e:TLSError` (default = `null`)``

dataAvailable | () | method |

`public function dataAvailable(e:* = null):void`

Parameters

| `e:*` (default = `null`)``

rejectPeerCertificate | () | method |

`public function rejectPeerCertificate():void`

sendApplicationData | () | method |

`public function sendApplicationData(data:ByteArray, offset:uint = 0, length:uint = 0):void`

Parameters

| `data:ByteArray`
| `offset:uint` (default = `0`)``
| `length:uint` (default = `0`)``

start | () | method |

`public function start():void`

This starts the TLS negotiation for a TLS Client. This is a no-op for a TLS Server.

Event Detail

close | Event

Event Object Type: `flash.events.Event`

data | Event |

Event Object Type: `com.hurlant.crypto.tls.TLSEvent`

ready | Event |

Event Object Type: `com.hurlant.crypto.tls.TLSEvent`

socketData | Event |

Event Object Type: `flash.events.ProgressEvent`

Constant Detail

CLIENT | Constant

`public static const CLIENT:uint = 1`

SERVER | Constant |

`public static const SERVER:uint = 0`

Mon May 20 2013, 09:16 PM +02:00