GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PKCS7_SET_TYPE(3) FreeBSD Library Functions Manual PKCS7_SET_TYPE(3)

PKCS7_set_type, PKCS7_set0_type_other
initialize type of PKCS#7 ContentInfo

#include <openssl/pkcs7.h>

int
PKCS7_set_type(PKCS7 *p7, int type);

int
PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *content);

These functions set the type of an unused ContentInfo structure p7.

The function PKCS7_set_type() also allocates and initializes an empty child object in p7. The type argument can be any of these NIDs, creating a child object of the indicated data type:

type argument data type of child version
ASN1_OCTET_STRING n.a.
PKCS7_DIGEST 0
PKCS7_ENCRYPT 0
PKCS7_ENVELOPE 0
PKCS7_SIGNED 1
PKCS7_SIGN_ENVELOPE 1

If the provided type is invalid, p7 remains unchanged and PKCS7_set_type() fails.

If memory allocation fails, PKCS7_set_type() fails and p7 may remain in an inconsistent state.

The function PKCS7_set0_type_other() accepts an arbitrary NID as the type and also sets the content, neither checking it in any way nor copying it.

For both functions, the rest of the internal state of p7 remains unchanged.

The function PKCS7_set_type() returns 1 on success or 0 on failure.

The function PKCS7_set0_type_other() does no error handling at all and always returns 1.

ASN1_OCTET_STRING_new(3), ASN1_TYPE_new(3), PKCS7_encrypt(3), PKCS7_new(3), PKCS7_set_content(3), PKCS7_sign(3)

The function PKCS7_set_type() first appeared in SSLeay 0.8.1 and PKCS7_set0_type_other() in OpenSSL 0.9.8. Both have been available since OpenBSD 2.4.

If p7 has already been in use before being passed to one of these functions, it will report success even though it leaks memory. Later on, if other functions try to use p7 in its former role, they are likely to misbehave.
May 20, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.