Struct sec1::EcPrivateKey
source · [−]pub struct EcPrivateKey<'a> {
pub private_key: &'a [u8],
pub parameters: Option<EcParameters>,
pub public_key: Option<&'a [u8]>,
}
der
only.Expand description
SEC1 elliptic curve private key.
Described in SEC1: Elliptic Curve Cryptography (Version 2.0) Appendix C.4 (p.108) and also RFC5915 Section 3:
ECPrivateKey ::= SEQUENCE {
version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
privateKey OCTET STRING,
parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
publicKey [1] BIT STRING OPTIONAL
}
When encoded as PEM (text), keys in this format begin with the following:
-----BEGIN EC PRIVATE KEY-----
Fields
private_key: &'a [u8]
Private key data.
parameters: Option<EcParameters>
Elliptic curve parameters.
public_key: Option<&'a [u8]>
Public key data, optionally available if version is V2.
Trait Implementations
sourceimpl<'a> Clone for EcPrivateKey<'a>
impl<'a> Clone for EcPrivateKey<'a>
sourcefn clone(&self) -> EcPrivateKey<'a>
fn clone(&self) -> EcPrivateKey<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for EcPrivateKey<'a>
impl<'a> Debug for EcPrivateKey<'a>
sourceimpl<'a> DecodeValue<'a> for EcPrivateKey<'a>
impl<'a> DecodeValue<'a> for EcPrivateKey<'a>
sourceimpl PemLabel for EcPrivateKey<'_>
Available on crate feature pem
only.
impl PemLabel for EcPrivateKey<'_>
pem
only.sourceimpl<'a> Sequence<'a> for EcPrivateKey<'a>
impl<'a> Sequence<'a> for EcPrivateKey<'a>
sourceimpl TryFrom<&'_ EcPrivateKey<'_>> for SecretDocument
Available on crate feature alloc
only.
impl TryFrom<&'_ EcPrivateKey<'_>> for SecretDocument
alloc
only.sourceimpl TryFrom<EcPrivateKey<'_>> for SecretDocument
Available on crate feature alloc
only.
impl TryFrom<EcPrivateKey<'_>> for SecretDocument
alloc
only.Auto Trait Implementations
impl<'a> RefUnwindSafe for EcPrivateKey<'a>
impl<'a> Send for EcPrivateKey<'a>
impl<'a> Sync for EcPrivateKey<'a>
impl<'a> Unpin for EcPrivateKey<'a>
impl<'a> UnwindSafe for EcPrivateKey<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
impl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
sourcefn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided Tag
decodable as a variant of this CHOICE
?
sourceimpl<'a, T> Decode<'a> for T where
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for T where
T: DecodeValue<'a> + FixedTag,
sourceimpl<T> DecodePem for T where
T: DecodeOwned + PemLabel,
impl<T> DecodePem for T where
T: DecodeOwned + PemLabel,
sourceimpl<T> Encode for T where
T: EncodeValue + Tagged,
impl<T> Encode for T where
T: EncodeValue + Tagged,
sourcefn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
sourcefn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Encoder
.
sourcefn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice containing the encoded message. Read more
sourceimpl<'a, M> EncodeValue for M where
M: Sequence<'a>,
impl<'a, M> EncodeValue for M where
M: Sequence<'a>,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more