1EVP_PKEY_GET_DEFAULT_DIGEST_NID(3osslO)penSESVLP_PKEY_GET_DEFAULT_DIGEST_NID(3ossl)
2
3
4

NAME

6       EVP_PKEY_get_default_digest_nid, EVP_PKEY_get_default_digest_name - get
7       default signature digest
8

SYNOPSIS

10        #include <openssl/evp.h>
11
12        int EVP_PKEY_get_default_digest_name(EVP_PKEY *pkey,
13                                             char *mdname, size_t mdname_sz);
14        int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
15

DESCRIPTION

17       EVP_PKEY_get_default_digest_name() fills in the default message digest
18       name for the public key signature operations associated with key pkey
19       into mdname, up to at most mdname_sz bytes including the ending NUL
20       byte.  The name could be "UNDEF", signifying that no digest should be
21       used.
22
23       EVP_PKEY_get_default_digest_nid() sets pnid to the default message
24       digest NID for the public key signature operations associated with key
25       pkey.  Note that some signature algorithms (i.e. Ed25519 and Ed448) do
26       not use a digest during signing.  In this case pnid will be set to
27       NID_undef.  This function is only reliable for legacy keys, which are
28       keys with a EVP_PKEY_ASN1_METHOD; these keys have typically been loaded
29       from engines, or created with EVP_PKEY_assign_RSA(3) or similar.
30

NOTES

32       For all current standard OpenSSL public key algorithms SHA256 is
33       returned.
34

RETURN VALUES

36       EVP_PKEY_get_default_digest_name() and
37       EVP_PKEY_get_default_digest_nid() both return 1 if the message digest
38       is advisory (that is other digests can be used) and 2 if it is
39       mandatory (other digests can not be used).  They return 0 or a negative
40       value for failure.  In particular a return value of -2 indicates the
41       operation is not supported by the public key algorithm.
42

SEE ALSO

44       EVP_PKEY_CTX_new(3), EVP_PKEY_sign(3),
45       EVP_PKEY_digestsign_supports_digest(3), EVP_PKEY_verify(3),
46       EVP_PKEY_verify_recover(3),
47

HISTORY

49       This function was added in OpenSSL 1.0.0.
50
52       Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
53
54       Licensed under the Apache License 2.0 (the "License").  You may not use
55       this file except in compliance with the License.  You can obtain a copy
56       in the file LICENSE in the source distribution or at
57       <https://www.openssl.org/source/license.html>.
58
59
60
613.0.5                             2022-11E-V0P1_PKEY_GET_DEFAULT_DIGEST_NID(3ossl)
Impressum