xref: /openbsd-src/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 (revision ab3cf6dbbb0d6598bc02e80a6c2cb70eb6ee5956)
1*ab3cf6dbSschwarze.\"	$OpenBSD: RSA_sign_ASN1_OCTET_STRING.3,v 1.7 2019/06/10 14:58:48 schwarze Exp $
2860a60ecSschwarze.\"	OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
38974101aSjmc.\"
4860a60ecSschwarze.\" This file was written by Ulf Moeller <ulf@openssl.org>.
5860a60ecSschwarze.\" Copyright (c) 2000 The OpenSSL Project.  All rights reserved.
6860a60ecSschwarze.\"
7860a60ecSschwarze.\" Redistribution and use in source and binary forms, with or without
8860a60ecSschwarze.\" modification, are permitted provided that the following conditions
9860a60ecSschwarze.\" are met:
10860a60ecSschwarze.\"
11860a60ecSschwarze.\" 1. Redistributions of source code must retain the above copyright
12860a60ecSschwarze.\"    notice, this list of conditions and the following disclaimer.
13860a60ecSschwarze.\"
14860a60ecSschwarze.\" 2. Redistributions in binary form must reproduce the above copyright
15860a60ecSschwarze.\"    notice, this list of conditions and the following disclaimer in
16860a60ecSschwarze.\"    the documentation and/or other materials provided with the
17860a60ecSschwarze.\"    distribution.
18860a60ecSschwarze.\"
19860a60ecSschwarze.\" 3. All advertising materials mentioning features or use of this
20860a60ecSschwarze.\"    software must display the following acknowledgment:
21860a60ecSschwarze.\"    "This product includes software developed by the OpenSSL Project
22860a60ecSschwarze.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23860a60ecSschwarze.\"
24860a60ecSschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25860a60ecSschwarze.\"    endorse or promote products derived from this software without
26860a60ecSschwarze.\"    prior written permission. For written permission, please contact
27860a60ecSschwarze.\"    openssl-core@openssl.org.
28860a60ecSschwarze.\"
29860a60ecSschwarze.\" 5. Products derived from this software may not be called "OpenSSL"
30860a60ecSschwarze.\"    nor may "OpenSSL" appear in their names without prior written
31860a60ecSschwarze.\"    permission of the OpenSSL Project.
32860a60ecSschwarze.\"
33860a60ecSschwarze.\" 6. Redistributions of any form whatsoever must retain the following
34860a60ecSschwarze.\"    acknowledgment:
35860a60ecSschwarze.\"    "This product includes software developed by the OpenSSL Project
36860a60ecSschwarze.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37860a60ecSschwarze.\"
38860a60ecSschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39860a60ecSschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40860a60ecSschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41860a60ecSschwarze.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42860a60ecSschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43860a60ecSschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44860a60ecSschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45860a60ecSschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46860a60ecSschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47860a60ecSschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48860a60ecSschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49860a60ecSschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50860a60ecSschwarze.\"
51*ab3cf6dbSschwarze.Dd $Mdocdate: June 10 2019 $
5229ab75b0Sschwarze.Dt RSA_SIGN_ASN1_OCTET_STRING 3
5329ab75b0Sschwarze.Os
5429ab75b0Sschwarze.Sh NAME
5529ab75b0Sschwarze.Nm RSA_sign_ASN1_OCTET_STRING ,
5629ab75b0Sschwarze.Nm RSA_verify_ASN1_OCTET_STRING
5729ab75b0Sschwarze.Nd RSA signatures
5829ab75b0Sschwarze.Sh SYNOPSIS
5929ab75b0Sschwarze.In openssl/rsa.h
6029ab75b0Sschwarze.Ft int
6129ab75b0Sschwarze.Fo RSA_sign_ASN1_OCTET_STRING
6229ab75b0Sschwarze.Fa "int dummy"
6329ab75b0Sschwarze.Fa "unsigned char *m"
6429ab75b0Sschwarze.Fa "unsigned int m_len"
6529ab75b0Sschwarze.Fa "unsigned char *sigret"
6629ab75b0Sschwarze.Fa "unsigned int *siglen"
6729ab75b0Sschwarze.Fa "RSA *rsa"
6829ab75b0Sschwarze.Fc
6929ab75b0Sschwarze.Ft int
7029ab75b0Sschwarze.Fo RSA_verify_ASN1_OCTET_STRING
7129ab75b0Sschwarze.Fa "int dummy"
7229ab75b0Sschwarze.Fa "unsigned char *m"
7329ab75b0Sschwarze.Fa "unsigned int m_len"
7429ab75b0Sschwarze.Fa "unsigned char *sigbuf"
7529ab75b0Sschwarze.Fa "unsigned int siglen"
7629ab75b0Sschwarze.Fa "RSA *rsa"
7729ab75b0Sschwarze.Fc
7829ab75b0Sschwarze.Sh DESCRIPTION
7929ab75b0Sschwarze.Fn RSA_sign_ASN1_OCTET_STRING
8029ab75b0Sschwarzesigns the octet string
8129ab75b0Sschwarze.Fa m
8229ab75b0Sschwarzeof size
8329ab75b0Sschwarze.Fa m_len
8429ab75b0Sschwarzeusing the private key
8529ab75b0Sschwarze.Fa rsa
8629ab75b0Sschwarzerepresented in DER using PKCS #1 padding.
8729ab75b0SschwarzeIt stores the signature in
8829ab75b0Sschwarze.Fa sigret
8929ab75b0Sschwarzeand the signature size in
9029ab75b0Sschwarze.Fa siglen .
9129ab75b0Sschwarze.Fa sigret
9229ab75b0Sschwarzemust point to
9329ab75b0Sschwarze.Fn RSA_size rsa
9429ab75b0Sschwarzebytes of memory.
9529ab75b0Sschwarze.Pp
9629ab75b0Sschwarze.Fa dummy
9729ab75b0Sschwarzeis ignored.
9829ab75b0Sschwarze.Pp
9929ab75b0Sschwarze.Fn RSA_verify_ASN1_OCTET_STRING
10029ab75b0Sschwarzeverifies that the signature
10129ab75b0Sschwarze.Fa sigbuf
10229ab75b0Sschwarzeof size
10329ab75b0Sschwarze.Fa siglen
10429ab75b0Sschwarzeis the DER representation of a given octet string
10529ab75b0Sschwarze.Fa m
10629ab75b0Sschwarzeof size
10729ab75b0Sschwarze.Fa m_len .
10829ab75b0Sschwarze.Fa dummy
10929ab75b0Sschwarzeis ignored.
11029ab75b0Sschwarze.Fa rsa
11129ab75b0Sschwarzeis the signer's public key.
11229ab75b0Sschwarze.Sh RETURN VALUES
11329ab75b0Sschwarze.Fn RSA_sign_ASN1_OCTET_STRING
11429ab75b0Sschwarzereturns 1 on success or 0 otherwise.
11529ab75b0Sschwarze.Fn RSA_verify_ASN1_OCTET_STRING
11629ab75b0Sschwarzereturns 1 on successful verification or 0 otherwise.
11729ab75b0Sschwarze.Pp
11829ab75b0SschwarzeThe error codes can be obtained by
11929ab75b0Sschwarze.Xr ERR_get_error 3 .
12029ab75b0Sschwarze.Sh SEE ALSO
12178bb7a80Sschwarze.Xr RSA_new 3 ,
12229ab75b0Sschwarze.Xr RSA_sign 3 ,
12329ab75b0Sschwarze.Xr RSA_verify 3
12429ab75b0Sschwarze.Sh HISTORY
12529ab75b0Sschwarze.Fn RSA_sign_ASN1_OCTET_STRING
12629ab75b0Sschwarzeand
12729ab75b0Sschwarze.Fn RSA_verify_ASN1_OCTET_STRING
12810e00d17Sschwarzefirst appeared in SSLeay 0.8.0 and have been available since
12947ef50e0Sschwarze.Ox 2.4 .
13029ab75b0Sschwarze.Sh BUGS
13129ab75b0SschwarzeThese functions serve no recognizable purpose.
132