xref: /freebsd/secure/lib/libcrypto/man/man3/X509_get0_signature.3 (revision 174c0ac687ec4ccb0b56ee30d48c0a7b8b9c4e15)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "X509_GET0_SIGNATURE 3ossl"
X509_GET0_SIGNATURE 3ossl "2023-09-19" "3.0.11" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
X509_get0_signature, X509_REQ_set0_signature, X509_REQ_set1_signature_algo, X509_get_signature_nid, X509_get0_tbs_sigalg, X509_REQ_get0_signature, X509_REQ_get_signature_nid, X509_CRL_get0_signature, X509_CRL_get_signature_nid, X509_get_signature_info, X509_SIG_INFO_get, X509_SIG_INFO_set - signature information
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/x509.h> \& void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x); void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig); int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg); int X509_get_signature_nid(const X509 *x); const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); \& void X509_REQ_get0_signature(const X509_REQ *crl, const ASN1_BIT_STRING **psig, const X509_ALGOR **palg); int X509_REQ_get_signature_nid(const X509_REQ *crl); \& void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, const X509_ALGOR **palg); int X509_CRL_get_signature_nid(const X509_CRL *crl); \& int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits, uint32_t *flags); \& int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid, int *secbits, uint32_t *flags); void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid, int secbits, uint32_t flags); .Ve
"DESCRIPTION"
Header "DESCRIPTION" \fBX509_get0_signature() sets *psig to the signature of x and *palg to the signature algorithm of x. The values returned are internal pointers which \s-1MUST NOT\s0 be freed up after the call.

\fBX509_set0_signature() and X509_REQ_set1_signature_algo() are the equivalent setters for the two values of X509_get0_signature().

\fBX509_get0_tbs_sigalg() returns the signature algorithm in the signed portion of x.

\fBX509_get_signature_nid() returns the \s-1NID\s0 corresponding to the signature algorithm of x.

\fBX509_REQ_get0_signature(), X509_REQ_get_signature_nid() \fBX509_CRL_get0_signature() and X509_CRL_get_signature_nid() perform the same function for certificate requests and CRLs.

\fBX509_get_signature_info() retrieves information about the signature of certificate x. The \s-1NID\s0 of the signing digest is written to *mdnid, the public key algorithm to *pknid, the effective security bits to \fB*secbits and flag details to *flags. Any of the parameters can be set to \s-1NULL\s0 if the information is not required.

\fBX509_SIG_INFO_get() and X509_SIG_INFO_set() get and set information about a signature in an X509_SIG_INFO structure. They are only used by implementations of algorithms which need to set custom signature information: most applications will never need to call them.

"NOTES"
Header "NOTES" These functions provide lower level access to signatures in certificates where an application wishes to analyse or generate a signature in a form where X509_sign() et al is not appropriate (for example a non standard or unsupported format).

The security bits returned by X509_get_signature_info() refers to information available from the certificate signature (such as the signing digest). In some cases the actual security of the signature is less because the signing key is less secure: for example a certificate signed using \s-1SHA-512\s0 and a 1024 bit \s-1RSA\s0 key.

"RETURN VALUES"
Header "RETURN VALUES" \fBX509_get_signature_nid(), X509_REQ_get_signature_nid() and \fBX509_CRL_get_signature_nid() return a \s-1NID.\s0

\fBX509_get0_signature(), X509_REQ_get0_signature() and \fBX509_CRL_get0_signature() do not return values.

\fBX509_get_signature_info() returns 1 if the signature information returned is valid or 0 if the information is not available (e.g. unknown algorithms or malformed parameters).

\fBX509_REQ_set1_signature_algo() returns 0 on success; or 1 on an error (e.g. null \s-1ALGO\s0 pointer). X509_REQ_set0_signature does not return an error value.

"SEE ALSO"
Header "SEE ALSO" \fBd2i_X509\|(3), \fBERR_get_error\|(3), \fBX509_CRL_get0_by_serial\|(3), \fBX509_get_ext_d2i\|(3), \fBX509_get_extension_flags\|(3), \fBX509_get_pubkey\|(3), \fBX509_get_subject_name\|(3), \fBX509_get_version\|(3), \fBX509_NAME_add_entry_by_txt\|(3), \fBX509_NAME_ENTRY_get_object\|(3), \fBX509_NAME_get_index_by_NID\|(3), \fBX509_NAME_print_ex\|(3), \fBX509_new\|(3), \fBX509_sign\|(3), \fBX509V3_get_d2i\|(3), \fBX509_verify_cert\|(3)
"HISTORY"
Header "HISTORY" The \fBX509_get0_signature() and X509_get_signature_nid() functions were added in OpenSSL 1.0.2.

The \fBX509_REQ_get0_signature(), X509_REQ_get_signature_nid(), \fBX509_CRL_get0_signature() and X509_CRL_get_signature_nid() were added in OpenSSL 1.1.0.

The X509_REQ_set0_signature() and X509_REQ_set1_signature_algo() were added in OpenSSL 1.1.1e.

"COPYRIGHT"
Header "COPYRIGHT" Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.