[][src]Struct opcua_server::prelude::PKey

pub struct PKey<T> { /* fields omitted */ }

This is a wrapper around an OpenSSL asymmetric key pair. Since openssl 0.10, the PKey is either a public or private key so we have to differentiate that as well.

Implementations

impl PKey<Private>[src]

pub fn new(bit_length: u32) -> PKey<Private>[src]

pub fn wrap_private_key(pkey: PKey<Private>) -> PKey<Private>[src]

pub fn from_pem(pem: &[u8]) -> Result<PKey<Private>, ()>[src]

pub fn private_key_to_pem(&self) -> Result<Vec<u8>, ()>[src]

pub fn sign_hmac_sha1(
    &self,
    data: &[u8],
    signature: &mut [u8]
) -> Result<usize, StatusCode>
[src]

Signs the data using RSA-SHA1

pub fn sign_hmac_sha256(
    &self,
    data: &[u8],
    signature: &mut [u8]
) -> Result<usize, StatusCode>
[src]

Signs the data using RSA-SHA256

pub fn sign_hmac_sha256_pss(
    &self,
    data: &[u8],
    signature: &mut [u8]
) -> Result<usize, StatusCode>
[src]

Signs the data using RSA-SHA256-PSS

pub fn private_decrypt(
    &self,
    src: &[u8],
    dst: &mut [u8],
    padding: RsaPadding
) -> Result<usize, ()>
[src]

Decrypts data in src to dst using the specified padding and returning the size of the decrypted data in bytes or an error.

impl PKey<Public>[src]

pub fn wrap_public_key(pkey: PKey<Public>) -> PKey<Public>[src]

pub fn verify_hmac_sha1(
    &self,
    data: &[u8],
    signature: &[u8]
) -> Result<bool, StatusCode>
[src]

Verifies the data using RSA-SHA1

pub fn verify_hmac_sha256(
    &self,
    data: &[u8],
    signature: &[u8]
) -> Result<bool, StatusCode>
[src]

Verifies the data using RSA-SHA256

pub fn verify_hmac_sha256_pss(
    &self,
    data: &[u8],
    signature: &[u8]
) -> Result<bool, StatusCode>
[src]

Verifies the data using RSA-SHA256-PSS

pub fn public_encrypt(
    &self,
    src: &[u8],
    dst: &mut [u8],
    padding: RsaPadding
) -> Result<usize, ()>
[src]

Encrypts data from src to dst using the specified padding and returns the size of encrypted data in bytes or an error.

Trait Implementations

impl<T> Debug for PKey<T>[src]

impl KeySize for PKey<Public>[src]

fn bit_length(&self) -> usize[src]

Length in bits

impl KeySize for PKey<Private>[src]

fn bit_length(&self) -> usize[src]

Length in bits

Auto Trait Implementations

impl<T> RefUnwindSafe for PKey<T> where
    T: RefUnwindSafe

impl<T> Send for PKey<T>

impl<T> Sync for PKey<T>

impl<T> Unpin for PKey<T> where
    T: Unpin

impl<T> UnwindSafe for PKey<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,