.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" 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'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "EVP_SIGNATURE-SM2 7ossl" .TH EVP_SIGNATURE-SM2 7ossl 2026-09-29 4.0.3 OpenSSL .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME EVP_SIGNATURE\-SM2 \- The EVP_PKEY SM2 signature implementation. .SH DESCRIPTION .IX Header "DESCRIPTION" Support for computing SM2 signatures. See \fBEVP_PKEY\-SM2\fR\|(7) for information related to SM2 keys. .PP This signature algorithm can be explicitly fetched with \&\fBEVP_PKEY_sign_init_ex2\fR\|(3), and implicitly fetched (through SM2 keys) with \fBEVP_DigestSignInit_ex\fR\|(3) and \&\fBEVP_DigestVerifyInit_ex\fR\|(3). .SS "SM2 Signature Parameters" .IX Subsection "SM2 Signature Parameters" The following signature parameters can be set using \&\fBEVP_PKEY_CTX_set_params\fR\|(3), \fBEVP_DigestSignInit_ex\fR\|(3) or \&\fBEVP_DigestVerifyInit_ex\fR\|(3). .IP """digest"" (\fBOSSL_SIGNATURE_PARAM_DIGEST\fR) " 4 .IX Item """digest"" (OSSL_SIGNATURE_PARAM_DIGEST) " This defaults to the \f(CW\*(C`SM3\*(C'\fR digest if not explicitly specified. .IP """digest\-size"" (\fBOSSL_SIGNATURE_PARAM_DIGEST\fR) " 4 .IX Item """digest-size"" (OSSL_SIGNATURE_PARAM_DIGEST) " This defaults to 32 bytes if not explicitly specified. Digests of a different size are not supported with \fBSM2\fR. .IP """distid"" (\fBOSSL_PKEY_PARAM_DIST_ID\fR) " 4 .IX Item """distid"" (OSSL_PKEY_PARAM_DIST_ID) " The \fIdistinguishing identifier\fR defaults to \f(CW1234567812345678\fR if not explicitly specified. .Sp An explicit empty distinguishing identifier value may need to be used to verify or create signatures that are compatible with versions of OpenSSL prior to 4.0. With the commandline tools an empty value can be specified with the use of either the \fB\-pkeyopt\fR (\fBopenssl\-pkeyutl\fR\|(1)) or \fB\-sigopt\fR (\fBopenssl\-dgst\fR\|(1)) option with a value of \f(CW\*(C`distid:\*(C'\fR. .IP """tls\-version"" (\fBOSSL_SIGNATURE_PARAM_TLS_VERSION\fR) " 4 .IX Item """tls-version"" (OSSL_SIGNATURE_PARAM_TLS_VERSION) " The OpenSSL 4.0 or later TLS protocol engine passes this parameter to the underlying signature algorithm when signing or verifying TLS \&\fBCertificateVerify\fR messages. When the protocol version is TLS 1.3 (0x0304), the SM2 signature algorithm will use the RFC8998 \fIdistinguished identifier\fR instead of the default value noted above. .PP The following signature parameters can be retrieved using \&\fBEVP_PKEY_CTX_get_params()\fR. .IP """algorithm\-id"" (\fBOSSL_SIGNATURE_PARAM_ALGORITHM_ID\fR) " 4 .IX Item """algorithm-id"" (OSSL_SIGNATURE_PARAM_ALGORITHM_ID) " This returns the DER encoding of the \fBSM2\-with\-SM3\fR signature OID. .IP """digest"" (\fBOSSL_SIGNATURE_PARAM_DIGEST\fR) " 4 .IX Item """digest"" (OSSL_SIGNATURE_PARAM_DIGEST) " .PD 0 .IP """digest\-size"" (\fBOSSL_SIGNATURE_PARAM_DIGEST\fR) " 4 .IX Item """digest-size"" (OSSL_SIGNATURE_PARAM_DIGEST) " .PD .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBEVP_PKEY_CTX_set_params\fR\|(3), \&\fBEVP_PKEY_sign\fR\|(3), \&\fBEVP_PKEY_verify\fR\|(3), \&\fBEVP_DigestSignInit_ex\fR\|(3), \&\fBEVP_DigestVerifyInit_ex\fR\|(3), \&\fBprovider\-signature\fR\|(7), .SH HISTORY .IX Header "HISTORY" The default value of the SM2 distinguishing identifier changed from empty to \&\f(CW1234567812345678\fR as of OpenSSL 4.0. .PP Support for the \fBOSSL_SIGNATURE_PARAM_TLS_VERSION\fR parameter was added in OpenSSL 4.0. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2020\-2026 The OpenSSL Project Authors. All Rights Reserved. .PP 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 .