pub struct CMSEncoder(/* private fields */);
Expand description
A type representing CMS encoder
Implementations§
Source§impl CMSEncoder
impl CMSEncoder
Sourcepub fn set_signer_algorithm(&self, digest_algorithm: &str) -> Result<()>
pub fn set_signer_algorithm(&self, digest_algorithm: &str) -> Result<()>
Sets the digest algorithm to use for the signer. Can be one of the predefined constants:
CMS_DIGEST_ALGORITHM_SHA1
CMS_DIGEST_ALGORITHM_SHA256
Sourcepub fn add_signers(&self, signers: &[SecIdentity]) -> Result<()>
pub fn add_signers(&self, signers: &[SecIdentity]) -> Result<()>
Specify signers of the CMS message; implies that the message will be signed
Sourcepub fn get_signers(&self) -> Result<Vec<SecIdentity>>
pub fn get_signers(&self) -> Result<Vec<SecIdentity>>
Obtains the array of signers specified with the add_signers
function
Sourcepub fn add_recipients(&self, recipients: &[SecCertificate]) -> Result<()>
pub fn add_recipients(&self, recipients: &[SecCertificate]) -> Result<()>
Specifies a message is to be encrypted and specifies the recipients of the message
Sourcepub fn get_recipients(&self) -> Result<Vec<SecCertificate>>
pub fn get_recipients(&self) -> Result<Vec<SecCertificate>>
Obtains the array of recipients specified with the add_recipients
function
Sourcepub fn set_has_detached_content(&self, has_detached_content: bool) -> Result<()>
pub fn set_has_detached_content(&self, has_detached_content: bool) -> Result<()>
Specifies whether the signed data is to be separate from the message
Sourcepub fn get_has_detached_content(&self) -> Result<bool>
pub fn get_has_detached_content(&self) -> Result<bool>
Indicates whether the message is to have detached content
Sourcepub fn set_encapsulated_content_type_oid(&self, oid: &str) -> Result<()>
pub fn set_encapsulated_content_type_oid(&self, oid: &str) -> Result<()>
Specifies an object identifier for the encapsulated data of a signed message
Sourcepub fn get_encapsulated_content_type(&self) -> Result<Vec<u8>>
pub fn get_encapsulated_content_type(&self) -> Result<Vec<u8>>
Obtains the object identifier for the encapsulated data of a signed message
Sourcepub fn add_supporting_certs(&self, certs: &[SecCertificate]) -> Result<()>
pub fn add_supporting_certs(&self, certs: &[SecCertificate]) -> Result<()>
Adds certificates to a message
Sourcepub fn get_supporting_certs(&self) -> Result<Vec<SecCertificate>>
pub fn get_supporting_certs(&self) -> Result<Vec<SecCertificate>>
Obtains the certificates added to a message with add_supporting_certs
Sourcepub fn add_signed_attributes(
&self,
signed_attributes: SignedAttributes,
) -> Result<()>
pub fn add_signed_attributes( &self, signed_attributes: SignedAttributes, ) -> Result<()>
Specifies attributes for a signed message
Sourcepub fn set_certificate_chain_mode(
&self,
certificate_chain_mode: CMSCertificateChainMode,
) -> Result<()>
pub fn set_certificate_chain_mode( &self, certificate_chain_mode: CMSCertificateChainMode, ) -> Result<()>
Specifies which certificates to include in a signed CMS message
Sourcepub fn get_certificate_chain_mode(&self) -> Result<CMSCertificateChainMode>
pub fn get_certificate_chain_mode(&self) -> Result<CMSCertificateChainMode>
Obtains a constant that indicates which certificates are to be included in a signed CMS message
Sourcepub fn update_content(&self, content: &[u8]) -> Result<()>
pub fn update_content(&self, content: &[u8]) -> Result<()>
Feeds content bytes into the encoder
Sourcepub fn get_encoded_content(&self) -> Result<Vec<u8>>
pub fn get_encoded_content(&self) -> Result<Vec<u8>>
Finishes encoding the message and obtains the encoded result
Sourcepub fn get_signer_timestamp(
&self,
signer_index: usize,
) -> Result<CFAbsoluteTime>
pub fn get_signer_timestamp( &self, signer_index: usize, ) -> Result<CFAbsoluteTime>
Returns the timestamp of a signer of a CMS message, if present
Sourcepub fn get_signer_timestamp_with_policy(
&self,
timestamp_policy: Option<CFStringRef>,
signer_index: usize,
) -> Result<CFAbsoluteTime>
pub fn get_signer_timestamp_with_policy( &self, timestamp_policy: Option<CFStringRef>, signer_index: usize, ) -> Result<CFAbsoluteTime>
Returns the timestamp of a signer of a CMS message using a particular policy, if present
Trait Implementations§
Source§impl Clone for CMSEncoder
impl Clone for CMSEncoder
Source§fn clone(&self) -> CMSEncoder
fn clone(&self) -> CMSEncoder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CMSEncoder
impl Debug for CMSEncoder
Source§impl Drop for CMSEncoder
impl Drop for CMSEncoder
Source§impl PartialEq for CMSEncoder
impl PartialEq for CMSEncoder
Source§impl TCFType for CMSEncoder
impl TCFType for CMSEncoder
Source§type Ref = *mut OpaqueCMSEncoderRef
type Ref = *mut OpaqueCMSEncoderRef
Source§fn as_concrete_TypeRef(&self) -> CMSEncoderRef
fn as_concrete_TypeRef(&self) -> CMSEncoderRef
TypeRef
.Source§unsafe fn wrap_under_get_rule(reference: CMSEncoderRef) -> Self
unsafe fn wrap_under_get_rule(reference: CMSEncoderRef) -> Self
CFTypeRef
subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped.Source§fn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
CFTypeRef
. The reference count is not adjusted.Source§unsafe fn wrap_under_create_rule(reference: CMSEncoderRef) -> Self
unsafe fn wrap_under_create_rule(reference: CMSEncoderRef) -> Self
CFTypeRef
subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped.Source§fn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
CFType
. The reference count is incremented by one.Source§fn into_CFType(self) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere
Self: Sized,
CFType
. Consumes self and avoids changing the reference
count.Source§fn retain_count(&self) -> isize
fn retain_count(&self) -> isize
Source§fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
true
if this value is an instance of another type.Source§impl<'a> ToVoid<CMSEncoder> for &'a CMSEncoder
impl<'a> ToVoid<CMSEncoder> for &'a CMSEncoder
Source§impl ToVoid<CMSEncoder> for CMSEncoderRef
impl ToVoid<CMSEncoder> for CMSEncoderRef
Source§impl ToVoid<CMSEncoder> for CMSEncoder
impl ToVoid<CMSEncoder> for CMSEncoder
impl ConcreteCFType for CMSEncoder
impl Eq for CMSEncoder
impl Send for CMSEncoder
impl Sync for CMSEncoder
Auto Trait Implementations§
impl Freeze for CMSEncoder
impl RefUnwindSafe for CMSEncoder
impl Unpin for CMSEncoder
impl UnwindSafe for CMSEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)