added toPublicPkcs method