A method to be performed by a manufacturing server (104, 1200, 1300), the method comprising: sending (200, 1224, 1324) a message to one or more portable electronic devices {i} (100, 1240, 1340), the message including a public key G (136, 1222, 1322) of a service entity (134, 1280, 1380) that provides a service Y; and for each portable electronic device i: computing a shared secret A i as a function F of a private key g (138, 1220, 1320) corresponding to the public key G and of a public key B i (116, 120, 124, 1212, 1312) of the portable electronic device i; providing (208, 506, 908, 1228) to the service entity, for use in establishing a trusted relationship between the service entity and the portable electronic device i, a service-specific device identifier ID i (114, 118, 122, 1218, 1318), associated with the service Y, of the portable electronic device i and a shared key SK i; computing each service-specific device identifier ID i by applying a first hash function to a combination of a service description value C Y (1216, 1316) associated with the service Y and one or more identifiers (1214, 1314) of the portable electronic device i, and wherein the combination is a concatenation of the service description value C Y and the one or more identifiers of the portable electronic device i, the method further comprising, for each portable electronic device i: computing a value T i by applying an advanced encryption standard algorithm to the shared secret A i and to a combination of a model description value of the portable electronic device i and the service-specific device identifier ID i; and computing the shared key SK i by applying a second hash function to the value T i. sending (200, 1224, 1324) a message to one or more portable electronic devices {i} (100, 1240, 1340), the message including a public key G (136, 1222, 1322) of a service entity (134, 1280, 1380) that provides a service Y; and for each portable electronic device i: computing a shared secret A i as a function F of a private key g (138, 1220, 1320) corresponding to the public key G and of a public key B i (116, 120, 124, 1212, 1312) of the portable electronic device i; providing (208, 506, 908, 1228) to the service entity, for use in establishing a trusted relationship between the service entity and the portable electronic device i, a service-specific device identifier ID i (114, 118, 122, 1218, 1318), associated with the service Y, of the portable electronic device i and a shared key SK i; computing each service-specific device identifier ID i by applying a first hash function to a combination of a service description value C Y (1216, 1316) associated with the service Y and one or more identifiers (1214, 1314) of the portable electronic device i, and wherein the combination is a concatenation of the service description value C Y and the one or more identifiers of the portable electronic device i, the method further comprising, for each portable electronic device i: computing a value T i by applying an advanced encryption standard algorithm to the shared secret A i and to a combination of a model description value of the portable electronic device i and the service-specific device identifier ID i; and computing the shared key SK i by applying a second hash function to the value T i. computing a shared secret A i as a function F of a private key g (138, 1220, 1320) corresponding to the public key G and of a public key B i (116, 120, 124, 1212, 1312) of the portable electronic device i; providing (208, 506, 908, 1228) to the service entity, for use in establishing a trusted relationship between the service entity and the portable electronic device i, a service-specific device identifier ID i (114, 118, 122, 1218, 1318), associated with the service Y, of the portable electronic device i and a shared key SK i; computing each service-specific device identifier ID i by applying a first hash function to a combination of a service description value C Y (1216, 1316) associated with the service Y and one or more identifiers (1214, 1314) of the portable electronic device i, and wherein the combination is a concatenation of the service description value C Y and the one or more identifiers of the portable electronic device i, the method further comprising, for each portable electronic device i: computing a value T i by applying an advanced encryption standard algorithm to the shared secret A i and to a combination of a model description value of the portable electronic device i and the service-specific device identifier ID i; and computing the shared key SK i by applying a second hash function to the value T i. computing a value T i by applying an advanced encryption standard algorithm to the shared secret A i and to a combination of a model description value of the portable electronic device i and the service-specific device identifier ID i; and computing the shared key SK i by applying a second hash function to the value T i.