use crate::error::Result;
use crate::ffi;
use crate::ffi_safe::call_for_string;
pub struct Recipient {
pub(crate) handle: ffi::rnp_recipient_handle_t,
}
impl Recipient {
pub(crate) fn new(handle: ffi::rnp_recipient_handle_t) -> Self {
Recipient { handle }
}
pub fn alg(&self) -> Result<String> {
call_for_string(|raw| unsafe { ffi::rnp_recipient_get_alg(self.handle, raw) })
}
pub fn keyid(&self) -> Result<String> {
call_for_string(|raw| unsafe { ffi::rnp_recipient_get_keyid(self.handle, raw) })
}
}