[−][src]Trait sgx_crypto_helper::RsaKeyPair
A trait to express the ability to create a RSA keypair with default e (65537) or customized e, and to_privkey/to_pubkey, encryption/decryption API.
Required methods
fn new() -> SgxResult<Self> where
Self: Sized,
Self: Sized,
Create a new RSA keypair with default e = 65537.
fn new_with_e(e: u32) -> SgxResult<Self> where
Self: Sized,
Self: Sized,
Create a new RSA keypair with customized e
fn to_privkey(self) -> SgxResult<SgxRsaPrivKey>
Get a private key instance typed SgxRsaPrivKey
which is defined in sgx_tcrypto/sgx_ucrypto.
fn to_pubkey(self) -> SgxResult<SgxRsaPubKey>
get a public key instance typed SgxPubPrivKey
which is defined in sgx_tcrypto/sgx_ucrypto.
fn encrypt_buffer(
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
Encrypt a u8 slice to a Vec
fn decrypt_buffer(
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>
Decrypt a u8 slice to a Vec
Implementors
impl RsaKeyPair for Rsa2048KeyPair
[src]
fn new() -> SgxResult<Self>
[src]
fn new_with_e(e: u32) -> SgxResult<Self>
[src]
fn to_privkey(self) -> SgxResult<SgxRsaPrivKey>
[src]
fn to_pubkey(self) -> SgxResult<SgxRsaPubKey>
[src]
fn encrypt_buffer(
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
[src]
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
fn decrypt_buffer(
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>
[src]
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>
impl RsaKeyPair for Rsa3072KeyPair
[src]
fn new() -> SgxResult<Self>
[src]
fn new_with_e(e: u32) -> SgxResult<Self>
[src]
fn to_privkey(self) -> SgxResult<SgxRsaPrivKey>
[src]
fn to_pubkey(self) -> SgxResult<SgxRsaPubKey>
[src]
fn encrypt_buffer(
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
[src]
self,
plaintext: &[u8],
ciphertext: &mut Vec<u8>
) -> SgxResult<usize>
fn decrypt_buffer(
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>
[src]
self,
ciphertext: &[u8],
plaintext: &mut Vec<u8>
) -> SgxResult<usize>