PKCS12_check_version¶
NAME¶
PKCS12_check_version - Checks the version of a PKCS #12 structure
SYNOPSIS¶
#include <openssl/pkcs12.h>
int PKCS12_check_version(const PKCS12 *p12);
DESCRIPTION¶
PKCS12_check_version() checks that the version info of a p12 PKCS #12 object is correct.
NOTES¶
A PKCS12 object can be loaded using d2i_PKC12(), d2i_PKC12_bio() or d2i_PKC12_fp(). The loaded object contains a version number, which should have the value of 3, in accordance with RFC 7292. As this version number was not previously checked on loading, adding the check to these functions would potentially break existing PKCS12 files. Instead of adding an _ex variant of all these functions, the function PKCS12_check_version() has been added instead. PKCS12_check_version() should be called after loading a PKCS #12 object, before calling either PKCS12_parse() or PKCS12_unpack_authsafes().
RETURN VALUES¶
PKCS12_check_version() returns 1 if the version info of a p12 object is correct, otherwise it returns 0.
CONFORMING TO¶
IETF RFC 7292 (https://tools.ietf.org/html/rfc7292).
SEE ALSO¶
d2i_PKCS12(3), d2i_PKC12_bio(3), d2i_PKC12_fp(3), PKCS12_parse(3).
HISTORY¶
PKCS12_check_version() was added in OpenSSL 4.2.
COPYRIGHT¶
Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.