pub fn from_pem<P: AsRef<str>>(pem: P) -> Result<Self, Error> {
        let pkey = PKey::public_key_from_pem(pem.as_ref().as_bytes())
            .map_err(|e| Error::parse_err(e.to_string()))?;
        let inner = pkey.ec_key().map_err(|e| Error::parse_err(e.to_string()))?;

        Ok(Self { inner })
    }
/// Decodes a P-256 public key from a PEM-encoded `SubjectPublicKeyInfo` structure.
///
/// The PEM data should have a header of `-----BEGIN PUBLIC KEY-----`.
///
/// The `SubjectPublicKeyInfo` structure is described in [RFC 5280].
///
/// # Examples
///
/// ```
/// # use gbl::{P256PublicKey, Error};
/// # fn run() -> Result<(), Box<Error>> {
/// let pem = r#"
/// -----BEGIN PUBLIC KEY-----
/// MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3Mev3ZLnwgv+u9cIRbNOkuotUsM4
/// qpto6Ctsgjd3KY8jaTnvMnJMQ0TIXwZqbzexPjWPiuWZYZk9HmNtaFzB4g==
/// -----END PUBLIC KEY-----
/// "#;
/// let pubkey = P256PublicKey::from_pem(pem)?;
/// # Ok(()) }   fn main() { run().unwrap(); }
/// ```
///
/// [RFC 5280]: https://tools.ietf.org/html/rfc5280
Decodes a P-256 public key from a PEM-encoded `SubjectPublicKeyInfo` structure.
The PEM data should have a header of `BEGIN PUBLIC KEY`.

The `SubjectPublicKeyInfo` structure is described in [RFC 5280].
Decodes a P - 256 public key from a PEM - encoded ` SubjectPublicKeyInfo ` structure . The PEM data should have a header of ` BEGIN PUBLIC KEY ` . The ` SubjectPublicKeyInfo ` structure is described in [ RFC 5280 ] .
pub fn from_pem<P: AsRef<str>>(pem: P) -> Result<Self, Error> {
        let pkey = PKey::public_key_from_pem(pem.as_ref().as_bytes())
            .map_err(|e| Error::parse_err(e.to_string()))?;
        let inner = pkey.ec_key().map_err(|e| Error::parse_err(e.to_string()))?;
        Ok(Self { inner })
    }
pub fn from_pem < P : AsRef < str > > ( pem : P ) -> Result < Self , Error > { let pkey = PKey :: public_key_from_pem ( pem . as_ref ( ) . as_bytes ( ) ) . map_err ( | e | Error :: parse_err ( e . to_string ( ) ) ) ? ; let inner = pkey . ec_key ( ) . map_err ( | e | Error :: parse_err ( e . to_string ( ) ) ) ? ; Ok ( Self { inner } ) }
Decodes a P-256 public key from a PEM-encoded `SubjectPublicKeyInfo` structure.
Decodes a P - 256 public key from a PEM - encoded ` SubjectPublicKeyInfo ` structure .
pem
P
examples
None
use gbl::{p256publickey, error};
None
fn run() -> result<(), box<error>> {
None
ok(()) }   fn main() { run().unwrap(); }
None