pub fn from_der<D: AsRef<[u8]>>(der: D) -> Result<Self, Error> {
        let pkey =
            PKey::public_key_from_der(der.as_ref()).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 DER-encoded `SubjectPublicKeyInfo` structure.
///
/// The `SubjectPublicKeyInfo` structure is described in [RFC 5280].
///
/// # Examples
///
/// ```
/// # use gbl::{P256PublicKey, Error};
/// # fn run() -> Result<(), Box<Error>> {
/// let der = [
///     0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
///     0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
///     0x42, 0x00, 0x04, 0xdc, 0xc7, 0xaf, 0xdd, 0x92, 0xe7, 0xc2, 0x0b, 0xfe,
///     0xbb, 0xd7, 0x08, 0x45, 0xb3, 0x4e, 0x92, 0xea, 0x2d, 0x52, 0xc3, 0x38,
///     0xaa, 0x9b, 0x68, 0xe8, 0x2b, 0x6c, 0x82, 0x37, 0x77, 0x29, 0x8f, 0x23,
///     0x69, 0x39, 0xef, 0x32, 0x72, 0x4c, 0x43, 0x44, 0xc8, 0x5f, 0x06, 0x6a,
///     0x6f, 0x37, 0xb1, 0x3e, 0x35, 0x8f, 0x8a, 0xe5, 0x99, 0x61, 0x99, 0x3d,
///     0x1e, 0x63, 0x6d, 0x68, 0x5c, 0xc1, 0xe2
/// ];
/// let pubkey = P256PublicKey::from_der(&der[..])?;
/// # Ok(()) }   fn main() { run().unwrap(); }
/// ```
///
/// [RFC 5280]: https://tools.ietf.org/html/rfc5280
Decodes a P-256 public key from a DER-encoded `SubjectPublicKeyInfo` structure.
The `SubjectPublicKeyInfo` structure is described in [RFC 5280].
Decodes a P - 256 public key from a DER - encoded ` SubjectPublicKeyInfo ` structure . The ` SubjectPublicKeyInfo ` structure is described in [ RFC 5280 ] .
pub fn from_der<D: AsRef<[u8]>>(der: D) -> Result<Self, Error> {
        let pkey =
            PKey::public_key_from_der(der.as_ref()).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_der < D : AsRef < [ u8 ] > > ( der : D ) -> Result < Self , Error > { let pkey = PKey :: public_key_from_der ( der . as_ref ( ) ) . 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 DER-encoded `SubjectPublicKeyInfo` structure.
Decodes a P - 256 public key from a DER - encoded ` SubjectPublicKeyInfo ` structure .
der
D
examples
None
use gbl::{p256publickey, error};
None
fn run() -> result<(), box<error>> {
None
ok(()) }   fn main() { run().unwrap(); }
None