From 64106c4d3d4ddba8c7bc2af75376e6d3d3d75601 Mon Sep 17 00:00:00 2001 From: Date: Mon, 29 Jun 2015 20:16:15 +0000 Subject: Update documentation --- openssl/crypto/pkey/struct.PKey.html | 153 +++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 openssl/crypto/pkey/struct.PKey.html (limited to 'openssl/crypto/pkey/struct.PKey.html') diff --git a/openssl/crypto/pkey/struct.PKey.html b/openssl/crypto/pkey/struct.PKey.html new file mode 100644 index 0000000..88638be --- /dev/null +++ b/openssl/crypto/pkey/struct.PKey.html @@ -0,0 +1,153 @@ + + + + + + + + + + openssl::crypto::pkey::PKey - Rust + + + + + + + + + + + + + + + +
+

Struct openssl::crypto::pkey::PKey + + [] + + [src]

+
pub struct PKey {
+    // some fields omitted
+}

Methods

impl PKey

Represents a public key, optionally with a private key attached.

+

fn new() -> PKey

+

fn from_handle(handle: *mut EVP_PKEY, parts: Parts) -> PKey

+

fn private_key_from_pem<R>(reader: &mut R) -> Result<PKey, SslError> where R: Read

+

Reads private key from PEM, takes ownership of handle

+

fn gen(&mut self, keysz: usize)

+

fn save_pub(&self) -> Vec<u8>

+

Returns a serialized form of the public key, suitable for load_pub().

+

fn load_pub(&mut self, s: &[u8])

+

Loads a serialized form of the public key, as produced by save_pub().

+

fn save_priv(&self) -> Vec<u8>

+

Returns a serialized form of the public and private keys, suitable for +load_priv().

+

fn load_priv(&mut self, s: &[u8])

+

Loads a serialized form of the public and private keys, as produced by +save_priv().

+

fn write_pem<W: Write>(&self, writer: &mut W) -> Result<(), SslError>

+

Stores private key as a PEM

+

fn size(&self) -> usize

+

Returns the size of the public key modulus.

+

fn can(&self, r: Role) -> bool

+

Returns whether this pkey object can perform the specified role.

+

fn max_data(&self) -> usize

+

Returns the maximum amount of data that can be encrypted by an encrypt() +call.

+

fn encrypt_with_padding(&self, s: &[u8], padding: EncryptionPadding) -> Vec<u8>

+

fn decrypt_with_padding(&self, s: &[u8], padding: EncryptionPadding) -> Vec<u8>

+

fn encrypt(&self, s: &[u8]) -> Vec<u8>

+

Encrypts data using OAEP padding, returning the encrypted data. The +supplied data must not be larger than max_data().

+

fn decrypt(&self, s: &[u8]) -> Vec<u8>

+

Decrypts data, expecting OAEP padding, returning the decrypted data.

+

fn sign(&self, s: &[u8]) -> Vec<u8>

+

Signs data, using OpenSSL's default scheme and adding sha256 ASN.1 information to the +signature. +The bytes to sign must be the result of a sha256 hashing; +returns the signature.

+

fn verify(&self, h: &[u8], s: &[u8]) -> bool

+

Verifies a signature s (using OpenSSL's default scheme and sha256) on the SHA256 hash of a +message. +Returns true if the signature is valid, and false otherwise.

+

fn sign_with_hash(&self, s: &[u8], hash: Type) -> Vec<u8>

+

Signs data, using OpenSSL's default scheme and add ASN.1 information for the given hash type to the +signature. +The bytes to sign must be the result of this type of hashing; +returns the signature.

+

fn verify_with_hash(&self, h: &[u8], s: &[u8], hash: Type) -> bool

+

unsafe fn get_handle(&self) -> *mut EVP_PKEY

+

fn public_eq(&self, other: &PKey) -> bool

+

Trait Implementations

impl Drop for PKey

fn drop(&mut self)

+
+ + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3