Method for watermarking digital media content received through a first interface by an application software, the digital media content being in a form of at least one encrypted sample, said digital media content being related to metadata assigned to each sample, said sample being encrypted by means of a sample key (Kc'), said metadata comprising first data, second data and a digital signature resulting from the signature of said first and second data, the first data comprising at least a content key (Kc) and watermarking metadata and at least said first data being encrypted by at least one transport key (KT, KT'), the content key (Kc) being used as first input in a cryptographic process, the second data comprising at least an initialization vector used as second input in said cryptographic process so that the content key (Kc) and the initialization vector allow to retrieve the sample key (Kc') for encrypting/decrypting each sample of said digital media content, said application software communicating through a second interface with a secure environment in charge of handling said metadata, said secure environment being able either to extract the transport key (KT, KT') from a secure memory or to derive said transport key (KT, KT') from a secret key (Ks) stored in said secure memory, the watermarking of the digital media content being performed by the following steps: - instructing the application software to get said metadata and to transmit it to the secure environment, - decrypting said first data within the secure environment by means of the transport key (KT, KT') to retrieve at least the content key (Kc) in an intelligible form, - verifying, by the secure environment, the authentication of said digitally signed first and second data (11, 12), in the case of a negative outcome, then undertaking countermeasures, whereas in the case of a positive outcome, then transmitting the watermarking metadata to a watermarking unit and transmitting the digital media content, the content key (Kc) and the initialization vector to a descrambler for descrambling each sample by means of the sample key (Kc'), - transmitting each descrambled sample to the watermarking unit for digitally marking it by means of at least said watermarking metadata, - transmitting the sample (15', 15") from the watermarking unit to the application software or to a secure media path for rendering purposes. - instructing the application software to get said metadata and to transmit it to the secure environment, - decrypting said first data within the secure environment by means of the transport key (KT, KT') to retrieve at least the content key (Kc) in an intelligible form, - verifying, by the secure environment, the authentication of said digitally signed first and second data (11, 12), in the case of a negative outcome, then undertaking countermeasures, whereas in the case of a positive outcome, then transmitting the watermarking metadata to a watermarking unit and transmitting the digital media content, the content key (Kc) and the initialization vector to a descrambler for descrambling each sample by means of the sample key (Kc'), - transmitting each descrambled sample to the watermarking unit for digitally marking it by means of at least said watermarking metadata, - transmitting the sample (15', 15") from the watermarking unit to the application software or to a secure media path for rendering purposes.