The present invention relates to a method for distribution of cryptographic keys by using public-key handling in a cryptographic method for data communication in a hierarchical communication network, which comprises nodes in the form of administrators and final operators. An identity in the form of a unique prime number which is known to all administrators and final operators is associated with each administrator in the tree. The main administrator of the tree selects one or more directly subordinated administrators. He also selects a basic secret which he keeps secret. The main administrator creates a subsecret for each directly subordinated administrator based on his own secret and the identity of each directly subordinated administrator. The subsecret is allocated to the associated subordinated administrator and he keeps it secret. In a recursive method, subordinated administrators in turn select in a corresponding manner subordinated administrators and create subsecrets for them. The final operators are allocated a pair of keys by their respective administrators, consisting of a private key, selected in a manner similar to the manner in which the identity of subordinated administrators is selected and a public key created in a manner corresponding to the manner in which a subsecret for a subordinated administrator is selected or vice versa.