1.\" $OpenBSD: ASN1_item_verify.3,v 1.2 2021/11/26 13:48:21 jsg Exp $ 2.\" 3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: November 26 2021 $ 18.Dt ASN1_ITEM_VERIFY 3 19.Os 20.Sh NAME 21.Nm ASN1_item_verify 22.Nd signature verification for ASN.1 values 23.Sh SYNOPSIS 24.In openssl/x509.h 25.Ft int 26.Fo ASN1_item_verify 27.Fa "const ASN1_ITEM *it" 28.Fa "X509_ALGOR *algor1" 29.Fa "ASN1_BIT_STRING *sig_in" 30.Fa "void *val_in" 31.Fa "EVP_PKEY *pkey" 32.Fc 33.Sh DESCRIPTION 34.Fn ASN1_item_verify 35assumes that 36.Fa val_in 37is an 38.Ft ASN1_VALUE 39of the type specified by 40.Fa it , 41encodes it into DER format by calling 42.Xr ASN1_item_i2d 3 , 43and verifies in a way similar to 44.Xr EVP_DigestVerify 3 45that 46.Fa sig_in 47contains a valid signature of the resulting byte array, 48a signature that was created with the digest type 49.Fa algor1 50and the private key corresponding to the public key 51.Fa pkey . 52.Sh RETURN VALUES 53.Fn ASN1_item_verify 54returns 1 if signature verification succeeds, 0 if signature verification 55fails, or \-1 if 56.Fa pkey 57is 58.Dv NULL , 59if 60.Fa sig_in 61contains invalid flags, or if 62.Fa algor1 63requests an invalid or unsupported digest algorithm 64or does not work with the given 65.Fa pkey . 66.Sh SEE ALSO 67.Xr ASN1_BIT_STRING_new 3 , 68.Xr ASN1_item_i2d 3 , 69.Xr ASN1_item_sign 3 , 70.Xr EVP_DigestVerify 3 , 71.Xr EVP_PKEY_new 3 , 72.Xr X509_ALGOR_new 3 73.Sh HISTORY 74.Fn ASN1_item_verify 75first appeared in OpenSSL 0.9.7 and has been available since 76.Ox 3.1 . 77