Generated API reference
@udid-tools/core
Section titled “@udid-tools/core”Classes
Section titled “Classes”UdidToolsError
Section titled “UdidToolsError”A sanitized, typed error. Secret input values are never included in its fields.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UdidToolsError(
code,message,options?):UdidToolsError
Parameters
Section titled “Parameters”message
Section titled “message”string
options?
Section titled “options?”Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
optionalcause?:unknown
Inherited from
Section titled “Inherited from”Error.cause
readonlycode:UdidToolsErrorCode
details
Section titled “details”
readonlydetails:Readonly<Record<string,unknown>> |undefined
message
Section titled “message”message:
string
Inherited from
Section titled “Inherited from”Error.message
name:
string
Inherited from
Section titled “Inherited from”Error.name
stack?
Section titled “stack?”
optionalstack?:string
Inherited from
Section titled “Inherited from”Error.stack
stackTraceLimit
Section titled “stackTraceLimit”
staticstackTraceLimit:number
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Methods
Section titled “Methods”captureStackTrace()
Section titled “captureStackTrace()”
staticcaptureStackTrace(targetObject,constructorOpt?):void
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};Error.captureStackTrace(myObject);myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() { b();}
function b() { c();}
function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error;}
a();Parameters
Section titled “Parameters”targetObject
Section titled “targetObject”object
constructorOpt?
Section titled “constructorOpt?”Function
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
prepareStackTrace()
Section titled “prepareStackTrace()”
staticprepareStackTrace(err,stackTraces):any
Parameters
Section titled “Parameters”Error
stackTraces
Section titled “stackTraces”CallSite[]
Returns
Section titled “Returns”any
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
Interfaces
Section titled “Interfaces”CertificateInfo
Section titled “CertificateInfo”Sanitized public metadata for an embedded CMS signer certificate.
Properties
Section titled “Properties”issuer
Section titled “issuer”
readonlyissuer:string
notAfter
Section titled “notAfter”
readonlynotAfter:Date
notBefore
Section titled “notBefore”
readonlynotBefore:Date
serialNumber
Section titled “serialNumber”
readonlyserialNumber:string
sha256Fingerprint
Section titled “sha256Fingerprint”
readonlysha256Fingerprint:string
subject
Section titled “subject”
readonlysubject:string
EncodedBinaryInput
Section titled “EncodedBinaryInput”A textual binary container with an explicit, strict decoding rule.
Properties
Section titled “Properties”encoding
Section titled “encoding”
readonlyencoding:"base64"|"pem"
readonlyvalue:string
GeneratedProfile
Section titled “GeneratedProfile”Generated XML or CMS profile bytes and format metadata.
Properties
Section titled “Properties”contentType
Section titled “contentType”
readonlycontentType:"application/x-apple-aspen-config"
readonlydata:Uint8Array
profile
Section titled “profile”
readonlyprofile:object
identifier
Section titled “identifier”
readonlyidentifier:string
readonlykind:"profile-service"
readonlyuuid:string
protection
Section titled “protection”
readonlyprotection:object
encrypted
Section titled “encrypted”
readonlyencrypted:false
signed
Section titled “signed”
readonlysigned:boolean
ParseProfileServiceResponseOptions
Section titled “ParseProfileServiceResponseOptions”Controls response acceptance, correlation, normalization, and resource limits.
Properties
Section titled “Properties”allowUnsigned?
Section titled “allowUnsigned?”
readonlyoptionalallowUnsigned?:boolean
expectedAttributes?
Section titled “expectedAttributes?”
readonlyoptionalexpectedAttributes?: readonly ("UDID"|"VERSION"|"PRODUCT"|"SERIAL"|"IMEI"|"MEID"|"ICCID"|"MAC_ADDRESS_EN0")[]
expectedChallenge?
Section titled “expectedChallenge?”
readonlyoptionalexpectedChallenge?:ProfileServiceChallenge
limits?
Section titled “limits?”
readonlyoptionallimits?:Partial<ResourceLimits>
requiredAttributes?
Section titled “requiredAttributes?”
readonlyoptionalrequiredAttributes?: readonly ("UDID"|"VERSION"|"PRODUCT"|"SERIAL"|"IMEI"|"MEID"|"ICCID"|"MAC_ADDRESS_EN0")[]
verification?
Section titled “verification?”
readonlyoptionalverification?:ResponseVerificationOptions
Pkcs12SigningIdentity
Section titled “Pkcs12SigningIdentity”PKCS#12/PFX signing identity supported by the beta cryptographic profile.
Properties
Section titled “Properties”
readonlydata:BinaryInput
passphrase?
Section titled “passphrase?”
readonlyoptionalpassphrase?:string
readonlytype:"pkcs12"
PlistDictionary
Section titled “PlistDictionary”A lossless property-list dictionary. Decoded dictionaries have a null prototype.
Indexable
Section titled “Indexable”[
key:string]:PlistValue
ProfileGenerationOptions
Section titled “ProfileGenerationOptions”Input to generateProfile.
Properties
Section titled “Properties”limits?
Section titled “limits?”
readonlyoptionallimits?:Partial<ResourceLimits>
profile
Section titled “profile”
readonlyprofile:ProfileServiceDefinition
signing?
Section titled “signing?”
readonlyoptionalsigning?:SigningOptions
ProfileServiceAttributes
Section titled “ProfileServiceAttributes”Known Apple response fields normalized to JavaScript naming.
Properties
Section titled “Properties”iccid?
Section titled “iccid?”
readonlyoptionaliccid?:string
readonlyoptionalimei?:string
macAddressEn0?
Section titled “macAddressEn0?”
readonlyoptionalmacAddressEn0?:string
readonlyoptionalmeid?:string
product?
Section titled “product?”
readonlyoptionalproduct?:string
serialNumber?
Section titled “serialNumber?”
readonlyoptionalserialNumber?:string
readonlyoptionaludid?:string
version?
Section titled “version?”
readonlyoptionalversion?:string
ProfileServiceDefinition
Section titled “ProfileServiceDefinition”Complete typed definition of Apple’s special Profile Service profile.
Properties
Section titled “Properties”description?
Section titled “description?”
readonlyoptionaldescription?:string
displayName
Section titled “displayName”
readonlydisplayName:string
extensions?
Section titled “extensions?”
readonlyoptionalextensions?:Readonly<Record<string,PlistValue>>
Additional top-level fields retained for forwards compatibility.
identifier
Section titled “identifier”
readonlyidentifier:string
readonlykind:"profile-service"
organization?
Section titled “organization?”
readonlyoptionalorganization?:string
service
Section titled “service”
readonlyservice:object
challenge?
Section titled “challenge?”
readonlyoptionalchallenge?:ProfileServiceChallenge
deviceAttributes
Section titled “deviceAttributes”
readonlydeviceAttributes: readonlyDeviceAttribute[]
extensions?
Section titled “extensions?”
readonlyoptionalextensions?:Readonly<Record<string,PlistValue>>
responseUrl
Section titled “responseUrl”
readonlyresponseUrl:string
readonlyoptionaluuid?:string
ProfileServiceResponse
Section titled “ProfileServiceResponse”Verified and decoded Apple Profile Service device response.
Properties
Section titled “Properties”attributes
Section titled “attributes”
readonlyattributes:ProfileServiceAttributes
challenge?
Section titled “challenge?”
readonlyoptionalchallenge?:string|Uint8Array<ArrayBufferLike>
readonlyraw:Readonly<Record<string,PlistValue>>
signature
Section titled “signature”
readonlysignature:object
present
Section titled “present”
readonlypresent:boolean
signers
Section titled “signers”
readonlysigners: readonlyCertificateInfo[]
trusted
Section titled “trusted”
readonlytrusted:boolean|null
readonlyvalid:boolean|null
ResourceLimits
Section titled “ResourceLimits”Bounded-work policy applied before and during parsing, encoding, and crypto.
Properties
Section titled “Properties”maxArrayItems
Section titled “maxArrayItems”
readonlymaxArrayItems:number
maxAsn1Depth
Section titled “maxAsn1Depth”
readonlymaxAsn1Depth:number
maxAsn1Nodes
Section titled “maxAsn1Nodes”
readonlymaxAsn1Nodes:number
maxCertificateBytes
Section titled “maxCertificateBytes”
readonlymaxCertificateBytes:number
maxCertificates
Section titled “maxCertificates”
readonlymaxCertificates:number
maxDictionaryKeys
Section titled “maxDictionaryKeys”
readonlymaxDictionaryKeys:number
maxInputBytes
Section titled “maxInputBytes”
readonlymaxInputBytes:number
maxOutputBytes
Section titled “maxOutputBytes”
readonlymaxOutputBytes:number
maxPlistDepth
Section titled “maxPlistDepth”
readonlymaxPlistDepth:number
maxStringBytes
Section titled “maxStringBytes”
readonlymaxStringBytes:number
SigningOptions
Section titled “SigningOptions”Optional signing configuration. Its presence requests signed output.
Properties
Section titled “Properties”certificateChain?
Section titled “certificateChain?”
readonlyoptionalcertificateChain?: readonlyBinaryInput[]
digestAlgorithm?
Section titled “digestAlgorithm?”
readonlyoptionaldigestAlgorithm?:"sha256"
identity
Section titled “identity”
readonlyidentity:Pkcs12SigningIdentity
UdidToolsErrorOptions
Section titled “UdidToolsErrorOptions”Properties
Section titled “Properties”details?
Section titled “details?”
readonlyoptionaldetails?:Readonly<Record<string,unknown>>
UdidToolsWarning
Section titled “UdidToolsWarning”Properties
Section titled “Properties”
readonlycode:UdidToolsWarningCode
details?
Section titled “details?”
readonlyoptionaldetails?:Readonly<Record<string,unknown>>
message
Section titled “message”
readonlymessage:string
Type Aliases
Section titled “Type Aliases”BinaryInput
Section titled “BinaryInput”BinaryInput =
EncodedBinaryInput|Uint8Array
Binary bytes or their explicit base64/PEM representation.
CertificateInput
Section titled “CertificateInput”CertificateInput =
BinaryInput
X.509 certificate input in DER bytes, canonical base64, or PEM.
CustomDeviceAttribute
Section titled “CustomDeviceAttribute”CustomDeviceAttribute =
string&object
Deliberately opted-in, forward-compatible uppercase device attribute.
Type Declaration
Section titled “Type Declaration”[customDeviceAttributeBrand]
Section titled “[customDeviceAttributeBrand]”
readonly[customDeviceAttributeBrand]:true
DeviceAttribute
Section titled “DeviceAttribute”DeviceAttribute =
CustomDeviceAttribute|KnownDeviceAttribute
A known or explicitly branded custom Profile Service attribute name.
KnownDeviceAttribute
Section titled “KnownDeviceAttribute”KnownDeviceAttribute = typeof
KNOWN_DEVICE_ATTRIBUTES[number]
A device attribute currently normalized by the public response API.
PlistPrimitive
Section titled “PlistPrimitive”PlistPrimitive =
boolean|Date|number|string|Uint8Array
Scalar values supported by the XML property-list codec.
PlistValue
Section titled “PlistValue”PlistValue =
PlistPrimitive| readonlyPlistValue[] |PlistDictionary
Any value representable by the library’s bounded XML property-list codec.
ProfileServiceChallenge
Section titled “ProfileServiceChallenge”ProfileServiceChallenge = {
type:"data";value:Uint8Array; } | {type:"string";value:string; }
Opaque correlation value included in the request profile and device response.
ProfileServiceResponseInput
Section titled “ProfileServiceResponseInput”ProfileServiceResponseInput =
ArrayBuffer|string|Uint8Array
Raw CMS/XML input accepted by the response parser.
ResourceLimitsInput
Section titled “ResourceLimitsInput”ResourceLimitsInput =
Partial<ResourceLimits>
Per-call resource-limit overrides.
ResponseVerificationOptions
Section titled “ResponseVerificationOptions”ResponseVerificationOptions = {
mode:"none"; } | {mode:"signature"; } | {intermediates?: readonlyCertificateInput[];mode:"trust-chain";trustAnchors: readonlyCertificateInput[]; }
Explicit response verification policy; no system trust is used.
Result
Section titled “Result”Result<
T> = {ok:true;value:T;warnings: readonlyUdidToolsWarning[]; } | {error:UdidToolsError;ok:false; }
Non-throwing operation result. Successful values may include actionable, non-fatal warnings; failures contain one sanitized typed error.
Type Parameters
Section titled “Type Parameters”T
UdidToolsErrorCode
Section titled “UdidToolsErrorCode”UdidToolsErrorCode =
"CERTIFICATE_KEY_MISMATCH"|"CHALLENGE_MISMATCH"|"INCORRECT_PASSPHRASE"|"INPUT_TOO_LARGE"|"INTERNAL_ERROR"|"INVALID_CERTIFICATE"|"INVALID_CONFIGURATION"|"INVALID_PKCS12"|"INVALID_PRIVATE_KEY"|"INVALID_PROFILE_IDENTIFIER"|"INVALID_RESPONSE_URL"|"INVALID_SIGNATURE"|"MALFORMED_CMS"|"MALFORMED_PLIST"|"MISSING_CHALLENGE"|"MISSING_REQUIRED_ATTRIBUTE"|"MISSING_SIGNING_MATERIAL"|"OUTPUT_TOO_LARGE"|"PROFILE_SIGNING_FAILED"|"UNSUPPORTED_ALGORITHM"|"UNTRUSTED_SIGNER"
Stable machine-readable error codes returned by the public API.
UdidToolsWarningCode
Section titled “UdidToolsWarningCode”UdidToolsWarningCode =
"CERTIFICATE_EXPIRES_SOON"|"CERTIFICATE_NOT_YET_VALID"|"DUPLICATE_CERTIFICATE_IGNORED"|"INSECURE_RESPONSE_URL"|"OPTIONAL_ATTRIBUTE_MISSING"|"SIGNER_TRUST_NOT_CHECKED"|"UNKNOWN_RESPONSE_ATTRIBUTE"
Variables
Section titled “Variables”DEFAULT_LIMITS
Section titled “DEFAULT_LIMITS”
constDEFAULT_LIMITS:Readonly<ResourceLimits>
Security-oriented defaults used independently for every operation.
KNOWN_DEVICE_ATTRIBUTES
Section titled “KNOWN_DEVICE_ATTRIBUTES”
constKNOWN_DEVICE_ATTRIBUTES: readonly ["UDID","VERSION","PRODUCT","SERIAL","IMEI","MEID","ICCID","MAC_ADDRESS_EN0"]
Attribute names documented across Apple’s Profile Service examples.
Functions
Section titled “Functions”customDeviceAttribute()
Section titled “customDeviceAttribute()”customDeviceAttribute(
value):CustomDeviceAttribute
Opt into a future or vendor-specific Profile Service attribute while keeping accidental arbitrary strings out of the normal typed configuration path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”generateProfile()
Section titled “generateProfile()”generateProfile(
options):Promise<Result<GeneratedProfile>>
Generate unsigned XML or signed CMS profile bytes without throwing.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<Result<GeneratedProfile>>
generateProfileOrThrow()
Section titled “generateProfileOrThrow()”generateProfileOrThrow(
options):Promise<GeneratedProfile>
Generate a profile and throw UdidToolsError on failure.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<GeneratedProfile>
parseProfileServiceResponse()
Section titled “parseProfileServiceResponse()”parseProfileServiceResponse(
input,options?):Promise<Result<ProfileServiceResponse>>
Verify, correlate, and parse a Profile Service response without throwing.
Parameters
Section titled “Parameters”options?
Section titled “options?”ParseProfileServiceResponseOptions = {}
Returns
Section titled “Returns”Promise<Result<ProfileServiceResponse>>
parseProfileServiceResponseOrThrow()
Section titled “parseProfileServiceResponseOrThrow()”parseProfileServiceResponseOrThrow(
input,options?):Promise<ProfileServiceResponse>
Parse a Profile Service response and throw UdidToolsError on failure.
Parameters
Section titled “Parameters”options?
Section titled “options?”ParseProfileServiceResponseOptions = {}
Returns
Section titled “Returns”Promise<ProfileServiceResponse>