Packagecom.hurlant.crypto.tls
Classpublic class TLSEngine
InheritanceTLSEngine Inheritance 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
 PropertyDefined By
  peerCertificate : X509Certificate
[read-only]
TLSEngine
  protocol_version : uint
TLSEngine
Public Methods
 MethodDefined By
  
TLSEngine(config:TLSConfig, iStream:IDataInput, oStream:IDataOutput, otherIdentity:String = null)
TLSEngine
  
TLSEngine
  
close(e:TLSError = null):void
TLSEngine
  
dataAvailable(e:* = null):void
TLSEngine
  
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
  TLSEngine
  TLSEngine
  TLSEngine
  TLSEngine
Public Constants
 ConstantDefined By
  CLIENT : uint = 1
[static]
TLSEngine
  SERVER : uint = 0
[static]
TLSEngine
Property Detail
peerCertificateproperty
peerCertificate:X509Certificate  [read-only]


Implementation
    public function get peerCertificate():X509Certificate
protocol_versionproperty 
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
CLIENTConstant
public static const CLIENT:uint = 1

SERVERConstant 
public static const SERVER:uint = 0