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 />

By obtaining, directly from the signer, a copy of the certificate, another certificate that serves as a trust anchor<br />

for the certificate, or suffici<strong>en</strong>t information to reliably id<strong>en</strong>tify the certificate, such as the public key.<br />

Asking the <strong>en</strong>d user of your application if they trust the certificate. Such a query is invalid with self-signed<br />

certificates since the id<strong>en</strong>tifying information in the certificate is inher<strong>en</strong>tly unreliable.<br />

The runtime verifies the cryptographic integrity of the signed data.<br />

The signed data is verified with the help of your IURIDerefer<strong>en</strong>cer implem<strong>en</strong>tation. For each refer<strong>en</strong>ce in the<br />

signature docum<strong>en</strong>t, the IURIDerefer<strong>en</strong>cer implem<strong>en</strong>tation derefer<strong>en</strong>ce() method is called. The data returned<br />

by the derefer<strong>en</strong>ce() method is used to compute the refer<strong>en</strong>ce digest. This digest value is compared to the digest<br />

recorded in the signature docum<strong>en</strong>t. If the digests match, th<strong>en</strong> the data has not be<strong>en</strong> altered since it was signed.<br />

One important consideration wh<strong>en</strong> relying on the results of validating an XML signature is that only what is signed<br />

is secure. For example, consider a signed manifest listing the files in a package. Wh<strong>en</strong> the XMLSignatureValidator<br />

verifies the signature, it only checks whether the manifest itself is unaltered. The data in the files is not signed, so<br />

the signature will still validate wh<strong>en</strong> files refer<strong>en</strong>ced in the manifest are changed or deleted.<br />

Note: To verify files in such a manifest, you can compute the digest of the file data (using the same hashing algorithm<br />

used in the manifest) and compare the result to the digest stored in the signed manifest. In some cases, you should also<br />

check for the pres<strong>en</strong>ce of additional files.<br />

Interpreting validation results<br />

Adobe AIR 1.5 and later<br />

The validation results are reported by the status properties of the XMLSignatureValidator object. These properties can<br />

be read after the validator object dispatches the complete ev<strong>en</strong>t. The four status properties include: validityStatus,<br />

digestStatus, id<strong>en</strong>tityStatus, and refer<strong>en</strong>cesStatus.<br />

The validityStatus property<br />

Adobe AIR 1.5 and later<br />

The validityStatus property reports the overall validity of the signature. The validityStatus dep<strong>en</strong>ds on the state<br />

of the other three status properties and can have one of the following values:<br />

valid — If digestStatus, id<strong>en</strong>tityStatus, and refer<strong>en</strong>cesStatus are all valid.<br />

invalid — If one or more of the individual status properties is invalid.<br />

unknown — If one or more of the individual status properties is unknown and no individual status is invalid.<br />

The digestStatus property<br />

Adobe AIR 1.5 and later<br />

The digestStatus property reports the results of the cryptographic verification of the message digest. The<br />

digestStatus property can have one of the following values:<br />

valid — If the signature docum<strong>en</strong>t itself is unaltered since signing.<br />

invalid — If the signature docum<strong>en</strong>t has be<strong>en</strong> altered or is malformed.<br />

unknown — If the verify() method has not completed without error.<br />

Last updated 6/6/2012<br />

858

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

Saved successfully!

Ooh no, something went wrong!