Struct ring::signature::EcdsaKeyPair [−][src]
pub struct EcdsaKeyPair { /* fields omitted */ }Expand description
An ECDSA key pair, used for signing.
Implementations
impl EcdsaKeyPair[src]
impl EcdsaKeyPair[src]pub fn generate_pkcs8(
alg: &'static EcdsaSigningAlgorithm,
rng: &dyn SecureRandom
) -> Result<Document, Unspecified>[src]
pub fn generate_pkcs8(
alg: &'static EcdsaSigningAlgorithm,
rng: &dyn SecureRandom
) -> Result<Document, Unspecified>[src]Generates a new key pair and returns the key pair serialized as a PKCS#8 document.
The PKCS#8 document will be a v1 OneAsymmetricKey with the public key
included in the ECPrivateKey structure, as described in
RFC 5958 Section 2 and RFC 5915. The ECPrivateKey structure will
not have a parameters field so the generated key is compatible with
PKCS#11.
pub fn from_pkcs8(
alg: &'static EcdsaSigningAlgorithm,
pkcs8: &[u8]
) -> Result<Self, KeyRejected>[src]
pub fn from_pkcs8(
alg: &'static EcdsaSigningAlgorithm,
pkcs8: &[u8]
) -> Result<Self, KeyRejected>[src]Constructs an ECDSA key pair by parsing an unencrypted PKCS#8 v1
id-ecPublicKey ECPrivateKey key.
The input must be in PKCS#8 v1 format. It must contain the public key in
the ECPrivateKey structure; from_pkcs8() will verify that the public
key and the private key are consistent with each other. The algorithm
identifier must identify the curve by name; it must not use an
“explicit” encoding of the curve. The parameters field of the
ECPrivateKey, if present, must be the same named curve that is in the
algorithm identifier in the PKCS#8 header.
pub fn from_private_key_and_public_key(
alg: &'static EcdsaSigningAlgorithm,
private_key: &[u8],
public_key: &[u8]
) -> Result<Self, KeyRejected>[src]
pub fn from_private_key_and_public_key(
alg: &'static EcdsaSigningAlgorithm,
private_key: &[u8],
public_key: &[u8]
) -> Result<Self, KeyRejected>[src]Constructs an ECDSA key pair directly from the big-endian-encoded private key and public key bytes.
This is intended for use by code that deserializes key pairs. It is
recommended to use RsaPubeyPair::from_pkcs8() (with a PKCS#8-encoded
key) instead.
pub fn sign(
&self,
rng: &dyn SecureRandom,
message: &[u8]
) -> Result<Signature, Unspecified>[src]
pub fn sign(
&self,
rng: &dyn SecureRandom,
message: &[u8]
) -> Result<Signature, Unspecified>[src]Returns the signature of the message using a random nonce
generated by rng.
Trait Implementations
impl Debug for EcdsaKeyPair[src]
impl Debug for EcdsaKeyPair[src]impl KeyPair for EcdsaKeyPair[src]
impl KeyPair for EcdsaKeyPair[src]type PublicKey = PublicKey
type PublicKey = PublicKeyThe type of the public key.
fn public_key(&self) -> &Self::PublicKey[src]
fn public_key(&self) -> &Self::PublicKey[src]The public key for the key pair.