¡@

Home 

2014/10/15 ¤U¤È 10:12:37

iphone Programming Glossary: pkcs7

A complete solution to LOCALLY validate an in-app receipts and bundle receipts on iOS 7

http://stackoverflow.com/questions/19943183/a-complete-solution-to-locally-validate-an-in-app-receipts-and-bundle-receipts-o

path const char cpath path stringByStandardizingPath fileSystemRepresentation FILE fp fopen cpath rb if fp return nil PKCS7 p7 d2i_PKCS7_fp fp NULL fclose fp if p7 return nil NSData data NSURL certificateURL NSBundle mainBundle URLForResource @.. cpath path stringByStandardizingPath fileSystemRepresentation FILE fp fopen cpath rb if fp return nil PKCS7 p7 d2i_PKCS7_fp fp NULL fclose fp if p7 return nil NSData data NSURL certificateURL NSBundle mainBundle URLForResource @ AppleIncRootCertificate.. if self verifyPCKS7 p7 withCertificateData certificateData struct pkcs7_st contents p7 d.sign contents if PKCS7_type_is_data contents ASN1_OCTET_STRING octets contents d.data data NSData dataWithBytes octets data length octets length..

Signing iPhone Configuration XML Profile with Ruby on Rails

http://stackoverflow.com/questions/4446247/signing-iphone-configuration-xml-profile-with-ruby-on-rails

AESCrypt decryption between iOS and PHP

http://stackoverflow.com/questions/6461419/aescrypt-decryption-between-ios-and-php

function decrypt_data data key return mcrypt_decrypt MCRYPT_RIJNDAEL_256 key data MCRYPT_MODE_ECB function unpadPKCS7 data blockSize length strlen data if length 0 first substr data 1 if ord first blockSize for i length 2 i 0 i if ord data.. 2 i 0 i if ord data i first break return substr data 0 i return data function decrypt_string string string unpadPKCS7 string 128 string decrypt_data string a16byteslongkey return string die ' br Basic '.decrypt_string '7opqbb7sEVNoXplyQv.. padding on your key is likely because AES256 requires a 32 byte key. The 0x0B padding on the plaintext is thanks to PKCS7 . PKCS7 is a padding scheme where the byte used for padding is equal in value to the number of bytes added. In this example..

Validate certificate and provisioning profile

http://stackoverflow.com/questions/6712895/validate-certificate-and-provisioning-profile

this question Answering my own question I hope this helps someone else. Turns out the mobileprovision file is a PKCS7 digitally signed message. It is not signed with the developer's certificate but with Apple's one. However the data that's.. key of the certificate you use to sign your binaries. So basically the steps are as follows Extract the data from the PKCS7 file. Extract the public key from the p12 file. Compare the two and check if they are the same. I managed to do this easily.. parts of the code are as follows profile File.read @profile_file certificate File.read @certificate_file p7 OpenSSL PKCS7.new profile cert OpenSSL PKCS12.new certificate @certificate_password store OpenSSL X509 Store.new p7.verify store plist..