A method of machining a key comprising the steps of: i) positioning a key to be machined in a self-centring vice comprising a first and a second jaw (21, 22); ii) shaping the profile of the key; characterized in that the step of positioning the key to be machined in the self-centring vice comprises the step of clamping a first portion of the key between the first and second jaws (21, 22), by simultaneously moving the first and second jaws (21, 22) nearer along a first direction as to: - position a first and a second face (701, 702) of said first portion of the key in contact, respectively, with a first and a second face (211, 212) of the first jaw; the first and second faces (701, 702) of the first portion being reciprocally transverse; - position a third and a fourth face (703, 704) of said first portion in contact, respectively, with a first and a second face (221, 222) of the second jaw; the third and the fourth face (703, 704) of the first portion being reciprocally transverse; said first direction forming a non-zero acute angle with both the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw; the steps of positioning a first and a second face (701, 702) of said first portion of the key in contact, respectively, with a first and a second face (211, 212) of the first jaw and of positioning a third and a fourth face (703, 704) of said first portion in contact, respectively, with a first and a second face (221, 222) of the second jaw imply that: * along a first part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key at two opposite edges of said first portion of the key; * along a second part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key by overlapping at least 70% of the perimeter of a transverse section of the first portion of the key. i) positioning a key to be machined in a self-centring vice comprising a first and a second jaw (21, 22); ii) shaping the profile of the key; characterized in that the step of positioning the key to be machined in the self-centring vice comprises the step of clamping a first portion of the key between the first and second jaws (21, 22), by simultaneously moving the first and second jaws (21, 22) nearer along a first direction as to: - position a first and a second face (701, 702) of said first portion of the key in contact, respectively, with a first and a second face (211, 212) of the first jaw; the first and second faces (701, 702) of the first portion being reciprocally transverse; - position a third and a fourth face (703, 704) of said first portion in contact, respectively, with a first and a second face (221, 222) of the second jaw; the third and the fourth face (703, 704) of the first portion being reciprocally transverse; - position a first and a second face (701, 702) of said first portion of the key in contact, respectively, with a first and a second face (211, 212) of the first jaw; the first and second faces (701, 702) of the first portion being reciprocally transverse; - position a third and a fourth face (703, 704) of said first portion in contact, respectively, with a first and a second face (221, 222) of the second jaw; the third and the fourth face (703, 704) of the first portion being reciprocally transverse; said first direction forming a non-zero acute angle with both the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw; the steps of positioning a first and a second face (701, 702) of said first portion of the key in contact, respectively, with a first and a second face (211, 212) of the first jaw and of positioning a third and a fourth face (703, 704) of said first portion in contact, respectively, with a first and a second face (221, 222) of the second jaw imply that: * along a first part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key at two opposite edges of said first portion of the key; * along a second part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key by overlapping at least 70% of the perimeter of a transverse section of the first portion of the key. * along a first part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key at two opposite edges of said first portion of the key; * along a second part of the longitudinal extent of the key, the first and second faces (211, 212) of the first jaw and the first and second faces (221, 222) of the second jaw hold the key by overlapping at least 70% of the perimeter of a transverse section of the first portion of the key.