pub enum EcPrivKeyAnyCurve {
P256(EcPrivKey<P256>),
P384(EcPrivKey<P384>),
P521(EcPrivKey<P521>),
}Expand description
An elliptic curve private key whose curve is unknown at compile time.
An EcPrivKeyAnyCurve is an enum of EcPrivKeys over the three supported
curves.
Variants§
Implementations§
Source§impl EcPrivKeyAnyCurve
impl EcPrivKeyAnyCurve
Sourcepub fn public(&self) -> EcPubKeyAnyCurve
pub fn public(&self) -> EcPubKeyAnyCurve
Gets the public key corresponding to this private key.
Sourcepub fn parse_from_der(bytes: &[u8]) -> Result<EcPrivKeyAnyCurve, Error>
pub fn parse_from_der(bytes: &[u8]) -> Result<EcPrivKeyAnyCurve, Error>
Parses a private key in DER format with any curve.
parse_from_der is like DerPrivateKey::parse_from_der, but it
accepts any PCurve rather than a particular, static curve.
Since EcPrivKey requires a static PCurve type parameter, the
parse_from_der function on EcPrivKey’s DerPrivateKey
implementation can only be called when the curve is known ahead of time.
This function, on the other hand, accepts any curve.
Because the curve is not known statically, one must be specified in the DER input.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EcPrivKeyAnyCurve
impl RefUnwindSafe for EcPrivKeyAnyCurve
impl !Send for EcPrivKeyAnyCurve
impl !Sync for EcPrivKeyAnyCurve
impl Unpin for EcPrivKeyAnyCurve
impl UnwindSafe for EcPrivKeyAnyCurve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more