How to check сorrectness of the secret key?