.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" 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 .. .\" 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 C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . 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\} .el\{\ . 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. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, 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 .\" ======================================================================== .\" .IX Title "fr::crypto::EVP_PKEY_derive 3SSL" .TH fr::crypto::EVP_PKEY_derive 3SSL "2015-12-31" "1.0.2a 1.0.2c" "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 "NOM" .IX Header "NOM" EVP_PKEY_derive_init, EVP_PKEY_derive_set_peer, EVP_PKEY_derive \- Dériver un secret partagé d'algorithme à clef publique .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fB #include \fR .PP \&\fB int EVP_PKEY_derive_init(\s-1EVP_PKEY_CTX\s0 *\fR\fIctx\fR\fB);\fR \fBint EVP_PKEY_derive_set_peer(\s-1EVP_PKEY_CTX\s0 *\fR\fIctx\fR\fB, \s-1EVP_PKEY\s0 *\fR\fIpeer\fR\fB);\fR \fBint EVP_PKEY_derive(\s-1EVP_PKEY_CTX\s0 *\fR\fIctx\fR\fB, unsigned char *\fR\fIkey\fR\fB, size_t *\fR\fIkeylen\fR\fB);\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" La fonction \fBEVP_PKEY_derive_init\fR() initialise un contexte d'algorithme à clef publique en utilisant \fIpkey\fR pour une dérivation à secret partagé. .PP La fonction \fBEVP_PKEY_derive_set_peer\fR() définit la clef de pair : ce sera normalement une clef publique. .PP La fonction \fBEVP_PKEY_derive\fR() dérive un secret partagé en utilisant \&\fIctx\fR. Si \fIkey\fR est \s-1NULL,\s0 alors la taille maximale du tampon de sortie est écrite dans le paramètre \fIkeylen\fR. Si \fIkey\fR n'est pas \s-1NULL,\s0 alors, avant l'appel, le paramètre \fIkeylen\fR devrait contenir la taille du tampon \&\fIkey\fR ; si l'appel réussit, le secret partagé est écrit dans \fIkey\fR et la quantité de données écrites dans \fIkeylen\fR. .SH "NOTES" .IX Header "NOTES" Après l'appel de \fBEVP_PKEY_derive_init\fR(), des opérations de contrôle spécifiques à l'algorithme peuvent être réalisées pour définir n'importe quels paramètres appropriés à l'opération. .PP La fonction \fBEVP_PKEY_derive\fR() peut être appelée plus d'une fois sur le même contexte si plusieurs opérations sont réalisées en utilisant les mêmes paramètres. .SH "VALEURS DE RETOUR" .IX Header "VALEURS DE RETOUR" \&\fBEVP_PKEY_derive_init\fR() et \fBEVP_PKEY_derive\fR() renvoient \fB1\fR en cas de réussite et \fB0\fR ou une valeur négative en cas d'échec. En particulier, une valeur de retour de \fB\-2\fR indique que l'opération n'est pas permise par l'algorithme à clef publique. .SH "EXEMPLE" .IX Header "EXEMPLE" Dériver un secret partagé (par exemple des clefs \s-1DH\s0 ou \s-1EC\s0) : .PP .Vb 2 \& #include \& #include \& \& EVP_PKEY_CTX *ctx; \& unsigned char *skey; \& size_t skeylen; \& EVP_PKEY *pkey, *peerkey; \& /* Remarque : pkey et peerkey sont supposées déjà définies */ \& \& ctx = EVP_PKEY_CTX_new(pkey); \& if (!ctx) \& /* Une erreur est survenue */ \& if (EVP_PKEY_derive_init(ctx) <= 0) \& /* Erreur */ \& if (EVP_PKEY_derive_set_peer(ctx, peerkey) <= 0) \& /* Erreur */ \& \& /* Déterminer la taille du tampon */ \& if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0) \& /* Erreur */ \& \& skey = OPENSSL_malloc(skeylen); \& \& if (!skey) \& /* échec malloc */ \& \& if (EVP_PKEY_derive(ctx, skey, &skeylen) <= 0) \& /* Erreur */ \& \& /* Le secret partagé est skey octets écrits dans le tampon skey */ .Ve .SH "VOIR AUSSI" .IX Header "VOIR AUSSI" \&\fBEVP_PKEY_CTX_new\fR(3), \&\fBEVP_PKEY_encrypt\fR(3), \&\fBEVP_PKEY_decrypt\fR(3), \&\fBEVP_PKEY_sign\fR(3), \&\fBEVP_PKEY_verify\fR(3), \&\fBEVP_PKEY_verify_recover\fR(3) .SH "HISTORIQUE" .IX Header "HISTORIQUE" Ces fonctions ont été ajoutées pour la première fois dans OpenSSL 1.0.0. .SH "TRADUCTION" .IX Header "TRADUCTION" La traduction de cette page de manuel est maintenue par les membres de la liste . Veuillez signaler toute erreur de traduction par un rapport de bogue sur le paquet manpages-fr-extra.