### Generate an IMAP account profile Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Example of creating a signed configuration profile for an IMAP email account. ```javascript mobileconfig.getSignedConfig([ PayloadType: 'Configuration', PayloadVersion: 1, PayloadIdentifier: 'com.my.company', PayloadUUID: uuid.v4(), PayloadDisplayName: 'My Gmail Account', PayloadDescription: 'Install this profile to auto configure your email account', PayloadOrganization: 'My Company', PayloadContent: { PayloadType: 'com.apple.mail.managed', PayloadVersion: 1, PayloadIdentifier: 'com.my.company', PayloadUUID: uuid.v4(), PayloadDisplayName: 'IMAP Config', PayloadDescription: 'Configures email account', PayloadOrganization: 'My Company', EmailAccountDescription: 'Configure your email account', EmailAccountName: 'John Smith', EmailAccountType: 'EmailTypeIMAP', EmailAddress: 'my-email-address@gmail.com', IncomingMailServerAuthentication: 'EmailAuthPassword', IncomingMailServerHostName: 'imap.gmail.com', IncomingMailServerPortNumber: 993, IncomingMailServerUseSSL: true, IncomingMailServerUsername: 'my-email-address@gmail.com', IncomingPassword: 'verysecret', OutgoingPasswordSameAsIncomingPassword: true, OutgoingMailServerAuthentication: 'EmailAuthPassword', OutgoingMailServerHostName: 'smtp.gmail.com', OutgoingMailServerPortNumber: 587, OutgoingMailServerUseSSL: false, OutgoingMailServerUsername: 'my-email-address@gmail.com', PreventMove: false, PreventAppSheet: false, SMIMEEnabled: false, allowMailDrop: true } ], { key: '-----BEGIN PRIVATE KEY-----...', cert: '-----BEGIN CERTIFICATE-----...' }, callback) ``` -------------------------------- ### Generate and sign WiFi configuration Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates a signed WiFi profile. Requires a keys object containing the certificate and private key for signing. ```javascript mobileconfig.getSignedWifiConfig(options, callback); ``` -------------------------------- ### Generate and sign CardDAV configuration Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Use this method to create a signed CardDAV configuration profile. The resulting data is a signed DER file returned as a Buffer. ```javascript mobileconfig.getSignedCardDAVConfig(options, callback); ``` -------------------------------- ### Generate and sign Email configuration Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Use this method to create a signed email configuration profile. The resulting data is a signed DER file returned as a Buffer. ```javascript mobileconfig.getSignedEmailConfig(options, callback); ``` -------------------------------- ### Generate and sign a configuration profile Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Use this method to generate a signed DER file from plist data and signing keys. ```javascript mobileconfig.getSignedConfig(plistData, keys, callback); ``` -------------------------------- ### mobileconfig.getSignedWifiConfig Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates and signs a WiFi configuration profile. ```APIDOC ## mobileconfig.getSignedWifiConfig(options, callback) ### Description Generates and signs a WiFi configuration profile using the provided network settings and signing keys. ### Parameters - **options** (object) - Required - Configuration object containing organization, displayName, wifi settings (encryptionType, ssid, password), and keys for signing. - **callback** (function) - Required - Function receiving (err, data) once the configuration is generated. ``` -------------------------------- ### mobileconfig.getSignedCardDAVConfig(options, callback) Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates and signs a CardDAV account configuration profile. ```APIDOC ## mobileconfig.getSignedCardDAVConfig(options, callback) ### Description Generates and signs a CardDAV account configuration profile. ### Parameters - **options** (object) - Required - Configuration object containing organization, identifier, displayName, displayDescription, accountName, accountDescription, dav, and keys. - **callback** (function) - Required - Function (err, data) called upon completion. Returns an Error object or the signed DER file as a Buffer. ``` -------------------------------- ### Require the mobileconfig module Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Initialize the module by requiring it in your Node.js project. ```javascript const mobileconfig = require('mobileconfig'); ``` -------------------------------- ### mobileconfig.getSignedConfig(plistData, keys, callback) Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates and signs a mobileconfig configuration object. The resulting signed DER file is returned as a Buffer via the callback. ```APIDOC ## mobileconfig.getSignedConfig(plistData, keys, callback) ### Description Generates and signs a valid mobileconfig configuration object. The function takes the configuration data, signing credentials, and a callback to handle the result. ### Parameters - **plistData** (object) - Required - An object containing the plist fields for the configuration profile. - **keys** (object) - Required - An object containing the key and certificate for signing. Properties include: key (string, PEM format), cert (string, PEM format), ca (array, optional), hashAlg (string, optional), sigAlg (string, optional). - **callback** (function) - Required - A function with signature (err, data) where err is an Error object and data is the signed DER file as a Buffer. ``` -------------------------------- ### mobileconfig.getSignedEmailConfig(options, callback) Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates and signs an Email account configuration profile. ```APIDOC ## mobileconfig.getSignedEmailConfig(options, callback) ### Description Generates and signs an Email account configuration profile (IMAP only). ### Parameters - **options** (object) - Required - Configuration object containing emailAddress, organization, identifier, displayName, displayDescription, accountName, accountDescription, imap, smtp, and keys. - **callback** (function) - Required - Function (err, data) called upon completion. Returns an Error object or the signed DER file as a Buffer. ``` -------------------------------- ### mobileconfig.getSignedCalDAVConfig Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates and signs a CalDAV configuration profile. ```APIDOC ## mobileconfig.getSignedCalDAVConfig(options, callback) ### Description Generates and signs a CalDAV configuration profile based on the provided account data. ### Parameters - **options** (object) - Required - Configuration object containing organization, identifier, displayName, displayDescription, accountName, accountDescription, and dav server settings. - **callback** (function) - Required - Function receiving (err, data) where data is the signed DER file as a Buffer. ``` -------------------------------- ### Generate and sign CalDAV configuration Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Generates a signed CalDAV profile. The resulting data is a DER-encoded Buffer that should be saved with a .mobileconfig extension. ```javascript mobileconfig.getSignedCalDAVConfig(options, callback); ``` -------------------------------- ### Generate a signed email configuration profile Source: https://github.com/zone-eu/mobileconfig/blob/master/README.md Uses the getSignedEmailConfig method to create a configuration profile with IMAP, SMTP, and security key settings. ```javascript const mobileconfig = require('mobileconfig'); const options = { emailAddress: 'my-email-address@gmail.com', identifier: 'com.my.company', imap: { hostname: 'imap.gmail.com', secure: true, username: 'my-email-address@gmail.com', password: 'mypass' }, smtp: { hostname: 'smtp.gmail.com', port: 587, secure: false, username: 'my-email-address@gmail.com', password: false // use the same password as for IMAP }, keys: { key: '-----BEGIN PRIVATE KEY-----...', cert: '-----BEGIN CERTIFICATE-----...' } }; mobileconfig.getSignedEmailConfig(options, function (err, data) { console.log(err || data); }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.