implemented public key method