13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

XML signature validation in AIR<br />

Package Classes<br />

flash.security XMLSignatureValidator<br />

flash.ev<strong>en</strong>ts Ev<strong>en</strong>t<br />

Using the XML signature validation classes<br />

Adobe AIR 1.5 and later<br />

IURIDerefer<strong>en</strong>cer (interface)<br />

XMLSignatureValidator string constants are defined in the following classes:<br />

Refer<strong>en</strong>cesValidationSetting<br />

RevocationCheckSettings<br />

SignatureStatus<br />

SignerTrustSettings<br />

ErrorEv<strong>en</strong>t<br />

To use the XMLSignatureValidator class to validate an XML signature, you must:<br />

Create an XMLSignatureValidator object<br />

Provide an implem<strong>en</strong>tation of the IURIDerefer<strong>en</strong>cer interface. The XMLSignatureValidator object calls the<br />

IURIDerefer<strong>en</strong>cer derefer<strong>en</strong>ce() method, passing in the URI for each refer<strong>en</strong>ce in a signature. The<br />

derefer<strong>en</strong>ce() method must resolve the URI and return the refer<strong>en</strong>ced data (which could be in the same<br />

docum<strong>en</strong>t as the signature, or could be in an external resource).<br />

Set the certificate trust, revocation checking, and refer<strong>en</strong>ce validation settings of the XMLSignatureValidator object<br />

as appropriate for your application.<br />

Add ev<strong>en</strong>t list<strong>en</strong>ers for the complete and error ev<strong>en</strong>ts.<br />

Call the verify() method, passing in the signature to validate.<br />

Handle the complete and error ev<strong>en</strong>ts and interpret the results.<br />

The following example implem<strong>en</strong>ts a validate() function that verifies the validity of an XML signature. The<br />

XMLSignatureValidator properties are set such that the signing certificate must be in the system trust store, or chain<br />

to a certificate in the trust store. The example also assumes that a suitable IURIDerefer<strong>en</strong>cer class named<br />

XMLDerefer<strong>en</strong>cer exists.<br />

Last updated 6/6/2012<br />

856

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!