... $x509 = Crypt::OpenSSL::X509->new_from_string($cert); $rsa = Crypt::OpenSSL::RSA->new_public_key($x509->pubkey); ...