diff options
Diffstat (limited to 'src/lib/libcrypto/man/d2i_ECPKParameters.3')
| -rw-r--r-- | src/lib/libcrypto/man/d2i_ECPKParameters.3 | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/d2i_ECPKParameters.3 b/src/lib/libcrypto/man/d2i_ECPKParameters.3 new file mode 100644 index 0000000000..71d84b95c9 --- /dev/null +++ b/src/lib/libcrypto/man/d2i_ECPKParameters.3 | |||
| @@ -0,0 +1,188 @@ | |||
| 1 | .Dd $Mdocdate: November 5 2016 $ | ||
| 2 | .Dt D2I_ECPKPARAMETERS 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm d2i_ECPKParameters , | ||
| 6 | .Nm i2d_ECPKParameters , | ||
| 7 | .Nm d2i_ECPKParameters_bio , | ||
| 8 | .Nm i2d_ECPKParameters_bio , | ||
| 9 | .Nm d2i_ECPKParameters_fp , | ||
| 10 | .Nm i2d_ECPKParameters_fp , | ||
| 11 | .Nm ECPKParameters_print , | ||
| 12 | .Nm ECPKParameters_print_fp | ||
| 13 | .Nd decode and encode ASN.1 representations of elliptic curve entities | ||
| 14 | .Sh SYNOPSIS | ||
| 15 | .In openssl/ec.h | ||
| 16 | .Ft EC_GROUP * | ||
| 17 | .Fo d2i_ECPKParameters | ||
| 18 | .Fa "EC_GROUP **px" | ||
| 19 | .Fa "const unsigned char **in" | ||
| 20 | .Fa "long len" | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fo i2d_ECPKParameters | ||
| 24 | .Fa "const EC_GROUP *x" | ||
| 25 | .Fa "unsigned char **out" | ||
| 26 | .Fc | ||
| 27 | .Fd #define d2i_ECPKParameters_bio(bp,x)\ | ||
| 28 | ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) | ||
| 29 | .Fd #define i2d_ECPKParameters_bio(bp,x)\ | ||
| 30 | ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) | ||
| 31 | .Fd #define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL,\ | ||
| 32 | (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) | ||
| 33 | .Fd #define i2d_ECPKParameters_fp(fp,x)\ | ||
| 34 | ASN1_i2d_fp(i2d_ECPKParameters,(fp), (unsigned char *)(x)) | ||
| 35 | .Ft int | ||
| 36 | .Fo ECPKParameters_print | ||
| 37 | .Fa "BIO *bp" | ||
| 38 | .Fa "const EC_GROUP *x" | ||
| 39 | .Fa "int off" | ||
| 40 | .Fc | ||
| 41 | .Ft int | ||
| 42 | .Fo ECPKParameters_print_fp | ||
| 43 | .Fa "FILE *fp" | ||
| 44 | .Fa "const EC_GROUP *x" | ||
| 45 | .Fa "int off" | ||
| 46 | .Fc | ||
| 47 | .Sh DESCRIPTION | ||
| 48 | The ECPKParameters encode and decode routines encode and parse the | ||
| 49 | public parameters for an | ||
| 50 | .Vt EC_GROUP | ||
| 51 | structure, which represents a curve. | ||
| 52 | .Pp | ||
| 53 | .Fn d2i_ECPKParameters | ||
| 54 | attempts to decode | ||
| 55 | .Fa len | ||
| 56 | bytes at | ||
| 57 | .Pf * Fa in . | ||
| 58 | If successful, a pointer to the | ||
| 59 | .Vt EC_GROUP | ||
| 60 | structure is returned. | ||
| 61 | If an error occurred, then | ||
| 62 | .Dv NULL | ||
| 63 | is returned. | ||
| 64 | If | ||
| 65 | .Fa px | ||
| 66 | is not | ||
| 67 | .Dv NULL , | ||
| 68 | then the returned structure is written to | ||
| 69 | .Pf * Fa px . | ||
| 70 | If | ||
| 71 | .Pf * Fa px | ||
| 72 | is not | ||
| 73 | .Dv NULL , | ||
| 74 | then it is assumed that | ||
| 75 | .Pf * Fa px | ||
| 76 | contains a valid | ||
| 77 | .Vt EC_GROUP | ||
| 78 | structure and an attempt is made to reuse it. | ||
| 79 | If the call is successful, | ||
| 80 | .Pf * Fa in | ||
| 81 | is incremented to the byte following the parsed data. | ||
| 82 | .Pp | ||
| 83 | .Fn i2d_ECPKParameters | ||
| 84 | encodes the structure pointed to by | ||
| 85 | .Fa x | ||
| 86 | into DER format. | ||
| 87 | If | ||
| 88 | .Fa out | ||
| 89 | is not | ||
| 90 | .Dv NULL , | ||
| 91 | is writes the DER encoded data to the buffer at | ||
| 92 | .Pf * Fa out | ||
| 93 | and increments it to point after the data just written. | ||
| 94 | If the return value is negative, an error occurred, otherwise it returns | ||
| 95 | the length of the encoded data. | ||
| 96 | .Pp | ||
| 97 | If | ||
| 98 | .Pf * Fa out | ||
| 99 | is | ||
| 100 | .Dv NULL , | ||
| 101 | memory will be allocated for a buffer and the encoded data written to it. | ||
| 102 | In this case | ||
| 103 | .Pf * Fa out | ||
| 104 | is not incremented, and it points to the start of the data just written. | ||
| 105 | .Pp | ||
| 106 | .Fn d2i_ECPKParameters_bio | ||
| 107 | is similar to | ||
| 108 | .Fn d2i_ECPKParameters | ||
| 109 | except it attempts to parse data from | ||
| 110 | .Vt BIO | ||
| 111 | .Fa bp . | ||
| 112 | .Pp | ||
| 113 | .Fn d2i_ECPKParameters_fp | ||
| 114 | is similar to | ||
| 115 | .Fn d2i_ECPKParameters | ||
| 116 | except it attempts to parse data from the | ||
| 117 | .Vt FILE | ||
| 118 | pointer | ||
| 119 | .Fa fp . | ||
| 120 | .Pp | ||
| 121 | .Fn i2d_ECPKParameters_bio | ||
| 122 | is similar to | ||
| 123 | .Fn i2d_ECPKParameters | ||
| 124 | except it writes the encoding of the structure | ||
| 125 | .Fa x | ||
| 126 | to | ||
| 127 | .Vt BIO | ||
| 128 | .Fa bp | ||
| 129 | and it returns 1 for success or 0 for failure. | ||
| 130 | .Pp | ||
| 131 | .Fn i2d_ECPKParameters_fp | ||
| 132 | is similar to | ||
| 133 | .Fn i2d_ECPKParameters | ||
| 134 | except it writes the encoding of the structure | ||
| 135 | .Fa x | ||
| 136 | to | ||
| 137 | .Vt BIO | ||
| 138 | .Sy bp | ||
| 139 | and it returns 1 for success or 0 for failure. | ||
| 140 | .Pp | ||
| 141 | These functions are very similar to the X.509 functions described in | ||
| 142 | .Xr d2i_X509 3 , | ||
| 143 | where further notes and examples are available. | ||
| 144 | .Pp | ||
| 145 | The | ||
| 146 | .Fn ECPKParameters_print | ||
| 147 | and | ||
| 148 | .Fn ECPKParameters_print_fp | ||
| 149 | functions print human-readable output of the public parameters of the | ||
| 150 | .Vt EC_GROUP | ||
| 151 | to | ||
| 152 | .Fa bp | ||
| 153 | or | ||
| 154 | .Fa fp . | ||
| 155 | The output lines are indented by | ||
| 156 | .Fa off | ||
| 157 | spaces. | ||
| 158 | .Sh RETURN VALUES | ||
| 159 | .Fn d2i_ECPKParameters , | ||
| 160 | .Fn d2i_ECPKParameters_bio , | ||
| 161 | and | ||
| 162 | .Fn d2i_ECPKParameters_fp | ||
| 163 | return a valid | ||
| 164 | .Vt EC_GROUP | ||
| 165 | structure or | ||
| 166 | .Dv NULL | ||
| 167 | if an error occurs. | ||
| 168 | .Pp | ||
| 169 | .Fn i2d_ECPKParameters | ||
| 170 | returns the number of bytes successfully encoded or a negative value if | ||
| 171 | an error occurs. | ||
| 172 | .Pp | ||
| 173 | .Fn i2d_ECPKParameters_bio , | ||
| 174 | .Fn i2d_ECPKParameters_fp , | ||
| 175 | .Fn ECPKParameters_print , | ||
| 176 | and | ||
| 177 | .Fn ECPKParameters_print_fp | ||
| 178 | return 1 for success or 0 if an error occurs. | ||
| 179 | .Sh SEE ALSO | ||
| 180 | .Xr crypto 3 , | ||
| 181 | .Xr d2i_X509 3 , | ||
| 182 | .Xr ec 3 , | ||
| 183 | .Xr EC_GFp_simple_method 3 , | ||
| 184 | .Xr EC_GROUP_copy 3 , | ||
| 185 | .Xr EC_GROUP_new 3 , | ||
| 186 | .Xr EC_KEY_new 3 , | ||
| 187 | .Xr EC_POINT_add 3 , | ||
| 188 | .Xr EC_POINT_new 3 | ||
