GMimeApplicationPkcs7Mime

GMimeApplicationPkcs7Mime — Pkcs7 MIME parts

Functions

Types and Values

Description

A GMimeApplicationPkcs7Mime represents the application/pkcs7-mime MIME part.

Functions

g_mime_application_pkcs7_mime_new ()

GMimeApplicationPkcs7Mime *
g_mime_application_pkcs7_mime_new (GMimeSecureMimeType type);

Creates a new application/pkcs7-mime object.

Parameters

type

The type of S/MIME data contained within the part.

 

Returns

an empty application/pkcs7-mime object.


g_mime_application_pkcs7_mime_get_smime_type ()

GMimeSecureMimeType
g_mime_application_pkcs7_mime_get_smime_type
                               (GMimeApplicationPkcs7Mime *pkcs7_mime);

Gets the smime-type value of the Content-Type header.

Parameters

pkcs7_mime

A GMimeApplicationPkcs7Mime object

 

Returns

the smime-type value.


g_mime_application_pkcs7_mime_compress ()

GMimeApplicationPkcs7Mime *
g_mime_application_pkcs7_mime_compress
                               (GMimeEntity *entity,
                                GError **err);

Serializes entity using DOS newlines and compresses it as RFC 3274 CMS CompressedData using zlib. No crypto context is required.

Parameters

entity

a GMimeEntity to compress

 

err

return location for a GError, or NULL

 

Returns

a new compressed S/MIME part, or NULL on failure, with err set.

[nullable][transfer full]


g_mime_application_pkcs7_mime_decompress ()

GMimeEntity *
g_mime_application_pkcs7_mime_decompress
                               (GMimeApplicationPkcs7Mime *pkcs7_mime,
                                size_t max_size,
                                GError **err);

Decompresses RFC 3274 CMS CompressedData and parses its MIME content. Accepts DER and BER, including constructed OCTET STRINGs, with at most 32 nested ASN.1 containers. Only zlib compression and encapsulated id-data content are supported. No crypto context is required. The entire zlib stream, including its checksum, must be valid; truncated, trailing, or oversized content is rejected.

Parameters

pkcs7_mime

a GMimeApplicationPkcs7Mime

 

max_size

positive maximum decompressed size in bytes, including MIME headers

 

err

return location for a GError, or NULL

 

Returns

the decompressed entity, or NULL on failure, with err set. No partial entity is returned on failure.

[nullable][transfer full]


g_mime_application_pkcs7_mime_unwrap ()

GMimeEntity *
g_mime_application_pkcs7_mime_unwrap (GMimeApplicationPkcs7Mime *pkcs7_mime,
                                      GError **err);

Extracts the encapsulated id-data MIME entity from CMS SignedData without verifying signatures, digests, certificates, or trust. The returned entity is unverified and must not be presented as authenticated content.

Accepts DER and BER, including constructed OCTET STRINGs, with at most 32 nested ASN.1 containers. Checks container framing, but does not validate the contents of the digest, certificate, revocation, or signer sets. Detached signatures, other encapsulated content types, truncated containers, and trailing data are rejected. DOS newlines are normalized as for signature verification. No crypto context or crypto support is required.

Parameters

pkcs7_mime

a GMimeApplicationPkcs7Mime

 

err

return location for a GError, or NULL

 

Returns

the unverified entity, or NULL on failure, with err set. No partial entity is returned on failure.

[nullable][transfer full]


g_mime_application_pkcs7_mime_encrypt ()

GMimeApplicationPkcs7Mime *
g_mime_application_pkcs7_mime_encrypt (gpgme_ctx_t ctx,
                                       GMimeEntity *entity,
                                       gpgme_encrypt_flags_t flags,
                                       gpgme_key_t *recipients,
                                       gpgme_encrypt_result_t *result,
                                       GError **err);

Attempts to encrypt the entity MIME part to the public keys of recipients using S/MIME. If successful, a new application/pkcs7-mime object is returned.

[skip]

Parameters

ctx

a borrowed GPGME CMS context

 

entity

a GMimeEntity to encrypt

 

flags

native GPGME encryption flags

 

recipients

borrowed NULL-terminated recipient keys

 

result

a retained encryption result.

[out][optional]

err

a GError

 

Returns

a new GMimeApplicationPkcs7Mime object on success or NULL on fail. If encrypting fails, an exception will be set on err to provide information as to why the failure occurred.

[nullable][transfer full]


g_mime_application_pkcs7_mime_decrypt ()

GMimeEntity *
g_mime_application_pkcs7_mime_decrypt (GMimeApplicationPkcs7Mime *pkcs7_mime,
                                       gpgme_ctx_t ctx,
                                       gpgme_decrypt_result_t *result,
                                       GError **err);

Attempts to decrypt the encrypted application/pkcs7-mime part.

Context policy is unchanged. Release any returned result even on failure. Nested signed MIME entities must be verified separately.

[skip]

Parameters

pkcs7_mime

a GMimeApplicationPkcs7Mime

 

ctx

a borrowed GPGME CMS context

 

result

a retained native decryption result.

[out][optional]

err

a GError

 

Returns

the decrypted MIME part on success or NULL on fail. If the decryption fails, an exception will be set on err to provide information as to why the failure occurred.

[nullable][transfer full]


g_mime_application_pkcs7_mime_sign ()

GMimeApplicationPkcs7Mime *
g_mime_application_pkcs7_mime_sign (gpgme_ctx_t ctx,
                                    GMimeEntity *entity,
                                    gpgme_sign_result_t *result,
                                    GError **err);

Signs entity using the context's signers and S/MIME. If successful, a new application/pkcs7-mime object is returned.

[skip]

Parameters

ctx

a borrowed GPGME CMS context with configured signers

 

entity

a GMimeEntity

 

result

a retained signing result.

[out][optional]

err

a GError

 

Returns

a new GMimeApplicationPkcs7Mime object on success or NULL on fail. If signing fails, an exception will be set on err to provide information as to why the failure occurred.

[nullable][transfer full]


g_mime_application_pkcs7_mime_verify ()

gboolean
g_mime_application_pkcs7_mime_verify (GMimeApplicationPkcs7Mime *pkcs7_mime,
                                      gpgme_ctx_t ctx,
                                      GMimeEntity **entity,
                                      gpgme_verify_result_t *result,
                                      GError **err);

Attempts to verify the signed pkcs7_mime part and extract the original MIME entity.

[skip]

Parameters

pkcs7_mime

a GMimeApplicationPkcs7Mime

 

ctx

a borrowed GPGME CMS context

 

entity

the extracted entity.

[out][transfer full]

result

a retained native verification result.

[out][optional]

err

a GError

 

Returns

TRUE if verification and MIME parsing completed. Inspect individual signature status and validity; successful processing does not imply trust.

Types and Values

GMimeApplicationPkcs7Mime

typedef struct _GMimeApplicationPkcs7Mime GMimeApplicationPkcs7Mime;

An application/pkcs7-mime MIME part.


enum GMimeSecureMimeType

The S/MIME data type.

Members

GMIME_SECURE_MIME_TYPE_AUTH_ENVELOPED_DATA

The S/MIME content contains authenticated enveloped data.

 

GMIME_SECURE_MIME_TYPE_COMPRESSED_DATA

The S/MIME content contains compressed data.

 

GMIME_SECURE_MIME_TYPE_ENVELOPED_DATA

The S/MIME content contains enveloped data.

 

GMIME_SECURE_MIME_TYPE_SIGNED_DATA

The S/MIME content contains signed data.

 

GMIME_SECURE_MIME_TYPE_CERTS_ONLY

The S/MIME content contains only certificates.

 

GMIME_SECURE_MIME_TYPE_UNKNOWN

The S/MIME content is unknown.