ruby请教
#!/usr/bin/ruby -w# -*- coding: UTF-8 -*-
require 'openssl'
passcode_payload ={
'PayloadUUID' => 'RANDOM_STRING_UUID',
'PayloadOrganization' => 'PayloadOrganization',
'PayloadVersion' => 1,
'PayloadIdentifier' => 'com.test.PayloadIdentifier',
'PayloadType' => 'Configuration',
'PayloadDisplayName' => 'PayloadDisplayName',
'PayloadRemovalDisallowed' => false
}
passcode_payload_content = {
'PayloadDescription' => 'PayloadDescription',
'PayloadDisplayName' => 'PayloadDisplayName',
'PayloadIdentifier' => 'PayloadIdentifier',
'PayloadOrganization' => 'PayloadOrganization',
'PayloadType' => 'com.apple.mobiledevice.passwordpolicy',
'PayloadUUID' => "RANDOM_STRING_UUID",
'PayloadVersion' => 1,
'allowSimple' => true,
'forcePIN' => true,
'maxPINAgeInDays' => 20,
'minComplexChars' => 1,
'minLength' => 4,
'requireAlphanumeric' => true
}
passcode_payload_content_array = [passcode_payload_content]
puts passcode_payload_content_array
to_be_encrypted_plist = passcode_payload_content_array.to_plist
device_certificate = OpenSSL::X509::Certificate.new File.read('1.pem')
encrypted_payload = OpenSSL::PKCS7.encrypt([device_certificate],to_be_encrypted_plist, OpenSSL::Cipher::Cipher::new("des-ede3-cbc"),OpenSSL::PKCS7::BINARY)
passcode_payload['EncryptedPayloadContent'] = StringIO.new(encrypted_payload.to_der)
他提示在这passcode_payload_content_array.to_plist to_plist 方法不存在怎么办呢?
看不懂,555
页:
[1]