Commit 4692340e authored by Rich Salz's avatar Rich Salz
Browse files

Unify d2i/i2d documentation.



Make d2i_X509 a generic d2i/i2d manpage.
Pull common stuff out of other d2i/i2d docs.
Update find-doc-nits to know about "generic" manpages.
Cleanup some overlap.
Fix up a bunch of other references.

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
parent fbba5d11
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
=pod

=head1 NAME

ECPKParameters_print, ECPKParameters_print_fp - Functions for decoding and encoding ASN1 representations of elliptic curve entities

=head1 SYNOPSIS

 #include <openssl/ec.h>

 int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);

=head1 DESCRIPTION

The ECPKParameters represent the public parameters for an
B<EC_GROUP> structure, which represents a curve.

The ECPKParameters_print() and ECPKParameters_print_fp() functions print
a human-readable output of the public parameters of the EC_GROUP to B<bp>
or B<fp>. The output lines are indented by B<off> spaces.

=head1 RETURN VALUES

ECPKParameters_print() and ECPKParameters_print_fp()
return 1 for success and 0 if an error occurs.

=head1 SEE ALSO

L<crypto(3)>, L<ec(3)>, L<EC_GROUP_new(3)>, L<EC_GROUP_copy(3)>,
L<EC_POINT_new(3)>, L<EC_POINT_add(3)>, L<EC_KEY_new(3)>,
L<EC_GFp_simple_method(3)>,

=head1 COPYRIGHT

Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut
+8 −25
Original line number Diff line number Diff line
@@ -2,57 +2,40 @@

=head1 NAME

i2d_ECPrivateKey, d2i_ECPrivate_key - Encode and decode functions for saving and
reading EC_KEY structures
EC_KEY_get_enc_flags, EC_KEY_set_enc_flags
- Get and set flags for encoding EC_KEY structures

=head1 SYNOPSIS

 #include <openssl/ec.h>

 EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
 int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);

 unsigned int EC_KEY_get_enc_flags(const EC_KEY *key);
 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);

=head1 DESCRIPTION

The ECPrivateKey encode and decode routines encode and parse an
B<EC_KEY> structure into a binary format (ASN.1 DER) and back again.

These functions are similar to the d2i_X509() functions, and you should refer to
that page for a detailed description (see L<d2i_X509(3)>).

The format of the external representation of the public key written by
i2d_ECPrivateKey (such as whether it is stored in a compressed form or not) is
i2d_ECPrivateKey() (such as whether it is stored in a compressed form or not) is
described by the point_conversion_form. See L<EC_GROUP_copy(3)>
for a description of point_conversion_form.

When reading a private key encoded without an associated public key (e.g. if
EC_PKEY_NO_PUBKEY has been used - see below), then d2i_ECPrivateKey generates
EC_PKEY_NO_PUBKEY has been used - see below), then d2i_ECPrivateKey() generates
the missing public key automatically. Private keys encoded without parameters
(e.g. if EC_PKEY_NO_PARAMETERS has been used - see below) cannot be loaded using
d2i_ECPrivateKey.
d2i_ECPrivateKey().

The functions EC_KEY_get_enc_flags and EC_KEY_set_enc_flags get and set the
The functions EC_KEY_get_enc_flags() and EC_KEY_set_enc_flags() get and set the
value of the encoding flags for the B<key>. There are two encoding flags
currently defined - EC_PKEY_NO_PARAMETERS and EC_PKEY_NO_PUBKEY.  These flags
define the behaviour of how the  B<key> is converted into ASN1 in a call to
i2d_ECPrivateKey. If EC_PKEY_NO_PARAMETERS is set then the public parameters for
i2d_ECPrivateKey(). If EC_PKEY_NO_PARAMETERS is set then the public parameters for
the curve are not encoded along with the private key. If EC_PKEY_NO_PUBKEY is
set then the public key is not encoded along with the private key.

=head1 RETURN VALUES

d2i_ECPrivateKey() returns a valid B<EC_KEY> structure or B<NULL> if an error
occurs. The error code that can be obtained by
L<ERR_get_error(3)>.

i2d_ECPrivateKey() returns the number of bytes successfully encoded or a
negative value if an error occurs. The error code can be obtained by
L<ERR_get_error(3)>.

EC_KEY_get_enc_flags returns the value of the current encoding flags for the
EC_KEY_get_enc_flags() returns the value of the current encoding flags for the
EC_KEY.

=head1 SEE ALSO
+1 −13
Original line number Diff line number Diff line
@@ -2,14 +2,12 @@

=head1 NAME

d2i_X509_ALGOR, i2d_X509_ALGOR, X509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0, X509_ALGOR_set_md, X509_ALGOR_cmp - AlgorithmIdentifier functions
X509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0, X509_ALGOR_set_md, X509_ALGOR_cmp - AlgorithmIdentifier functions

=head1 SYNOPSIS

 #include <openssl/x509.h>

 X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, unsigned char **pp, long length);
 int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **pp);
 X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *alg);
 int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
 void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
@@ -19,12 +17,6 @@ d2i_X509_ALGOR, i2d_X509_ALGOR, X509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0

=head1 DESCRIPTION

The functions d2i_X509() and i2d_X509() decode and encode an B<X509_ALGOR>
structure which is equivalent to the B<AlgorithmIdentifier> structure.

Otherwise they behave in a similar way to d2i_X509() and i2d_X509()
described in the L<d2i_X509(3)> manual page.

X509_ALGOR_dup() returns a copy of B<alg>.

X509_ALGOR_set0() sets the algorithm OID of B<alg> to B<aobj> and the
@@ -44,10 +36,6 @@ values for the message digest B<md>.
X509_ALGOR_cmp() compares B<a> and B<b> and returns 0 if they have identical
encodings and non-zero otherwise.

=head1 SEE ALSO

L<d2i_X509(3)>

=head1 COPYRIGHT

Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
+0 −16
Original line number Diff line number Diff line
@@ -2,29 +2,16 @@

=head1 NAME

d2i_X509_NAME, i2d_X509_NAME - X509_NAME encoding functions

=head1 SYNOPSIS

 #include <openssl/x509.h>

 X509_NAME *d2i_X509_NAME(X509_NAME **a, unsigned char **pp, long length);
 int i2d_X509_NAME(X509_NAME *a, unsigned char **pp);

 int X509_NAME_get0_der(const unsigned char **pder, size_t *pderlen,
                        X509_NAME *nm)


=head1 DESCRIPTION

The functions d2i_X509_NAME() and i2d_X509_NAME() decode and encode an
B<X509_NAME> structure which is the same as the B<Name> type defined in
RFC3280 (and elsewhere) and used for example in certificate subject and
issuer names.

Otherwise the functions behave in a similar way to d2i_X509() and i2d_X509()
described in the L<d2i_X509(3)> manual page.

The function X509_NAME_get0_der() returns an internal pointer to the
encoding of an B<X509_NAME> structure in B<*pder> and consisting of
B<*pderlen> bytes. It is useful for applications that wish to examine
@@ -32,9 +19,6 @@ the encoding of an B<X509_NAME> structure without copying it.

=head1 RETURN VALUES

The meanings of the return values of d2i_X509_NAME() and i2d_X509_NAME()
are similar to those for d2i_X509() and i2d_X509().

The function X509_NAME_get0_der() returns 1 for success and 0 if an error
occurred.

+1 −10
Original line number Diff line number Diff line
@@ -2,26 +2,17 @@

=head1 NAME

d2i_X509_SIG, i2d_X509_SIG - DigestInfo functions
X509_SIG_get0 - Get DigestInfo functions

=head1 SYNOPSIS

 #include <openssl/x509.h>

 X509_SIG *d2i_X509_SIG(X509_SIG **a, unsigned char **pp, long length);
 int i2d_X509_SIG(X509_SIG *a, unsigned char **pp);
 void X509_SIG_get0(X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest,
                    X509_SIG *sig);

=head1 DESCRIPTION

The functions d2i_X509_SIG() and i2d_X509_SIG() decode and encode an
X509_SIG structure which is equivalent to the B<DigestInfo> structure
defined in PKCS#1 and PKCS#7.

Otherwise they behave in a similar way to d2i_X509() and i2d_X509()
described in the L<d2i_X509(3)> manual page.

X509_SIG_get0() returns pointers to the algorithm identifier and digest
value in B<sig>. These values can then be examined or initialised.

Loading