1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimEVP_PKEY_asn1_find, 6e71b7053SJung-uk KimEVP_PKEY_asn1_find_str, 7e71b7053SJung-uk KimEVP_PKEY_asn1_get_count, 8e71b7053SJung-uk KimEVP_PKEY_asn1_get0, 9e71b7053SJung-uk KimEVP_PKEY_asn1_get0_info 10e71b7053SJung-uk Kim- enumerate public key ASN.1 methods 11e71b7053SJung-uk Kim 12e71b7053SJung-uk Kim=head1 SYNOPSIS 13e71b7053SJung-uk Kim 14e71b7053SJung-uk Kim #include <openssl/evp.h> 15e71b7053SJung-uk Kim 16e71b7053SJung-uk Kim int EVP_PKEY_asn1_get_count(void); 17e71b7053SJung-uk Kim const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); 18e71b7053SJung-uk Kim const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); 19e71b7053SJung-uk Kim const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, 20e71b7053SJung-uk Kim const char *str, int len); 21e71b7053SJung-uk Kim int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, 22e71b7053SJung-uk Kim int *ppkey_flags, const char **pinfo, 23e71b7053SJung-uk Kim const char **ppem_str, 24e71b7053SJung-uk Kim const EVP_PKEY_ASN1_METHOD *ameth); 25e71b7053SJung-uk Kim 26e71b7053SJung-uk Kim=head1 DESCRIPTION 27e71b7053SJung-uk Kim 28e71b7053SJung-uk KimEVP_PKEY_asn1_count() returns a count of the number of public key 29e71b7053SJung-uk KimASN.1 methods available: it includes standard methods and any methods 30e71b7053SJung-uk Kimadded by the application. 31e71b7053SJung-uk Kim 32e71b7053SJung-uk KimEVP_PKEY_asn1_get0() returns the public key ASN.1 method B<idx>. 33e71b7053SJung-uk KimThe value of B<idx> must be between zero and EVP_PKEY_asn1_get_count() 34e71b7053SJung-uk Kim- 1. 35e71b7053SJung-uk Kim 36e71b7053SJung-uk KimEVP_PKEY_asn1_find() looks up the B<EVP_PKEY_ASN1_METHOD> with NID 37e71b7053SJung-uk KimB<type>. 38e71b7053SJung-uk KimIf B<pe> isn't B<NULL>, then it will look up an engine implementing a 39e71b7053SJung-uk KimB<EVP_PKEY_ASN1_METHOD> for the NID B<type> and return that instead, 40e71b7053SJung-uk Kimand also set B<*pe> to point at the engine that implements it. 41e71b7053SJung-uk Kim 42e71b7053SJung-uk KimEVP_PKEY_asn1_find_str() looks up the B<EVP_PKEY_ASN1_METHOD> with PEM 43e71b7053SJung-uk Kimtype string B<str>. 44e71b7053SJung-uk KimJust like EVP_PKEY_asn1_find(), if B<pe> isn't B<NULL>, then it will 45e71b7053SJung-uk Kimlook up an engine implementing a B<EVP_PKEY_ASN1_METHOD> for the NID 46e71b7053SJung-uk KimB<type> and return that instead, and also set B<*pe> to point at the 47e71b7053SJung-uk Kimengine that implements it. 48e71b7053SJung-uk Kim 49e71b7053SJung-uk KimEVP_PKEY_asn1_get0_info() returns the public key ID, base public key 50e71b7053SJung-uk KimID (both NIDs), any flags, the method description and PEM type string 51e71b7053SJung-uk Kimassociated with the public key ASN.1 method B<*ameth>. 52e71b7053SJung-uk Kim 53e71b7053SJung-uk KimEVP_PKEY_asn1_count(), EVP_PKEY_asn1_get0(), EVP_PKEY_asn1_find() and 54e71b7053SJung-uk KimEVP_PKEY_asn1_find_str() are not thread safe, but as long as all 55e71b7053SJung-uk KimB<EVP_PKEY_ASN1_METHOD> objects are added before the application gets 56e71b7053SJung-uk Kimthreaded, using them is safe. See L<EVP_PKEY_asn1_add0(3)>. 57e71b7053SJung-uk Kim 58e71b7053SJung-uk Kim=head1 RETURN VALUES 59e71b7053SJung-uk Kim 60e71b7053SJung-uk KimEVP_PKEY_asn1_count() returns the number of available public key methods. 61e71b7053SJung-uk Kim 62e71b7053SJung-uk KimEVP_PKEY_asn1_get0() return a public key method or B<NULL> if B<idx> is 63e71b7053SJung-uk Kimout of range. 64e71b7053SJung-uk Kim 65e71b7053SJung-uk KimEVP_PKEY_asn1_get0_info() returns 0 on failure, 1 on success. 66e71b7053SJung-uk Kim 67e71b7053SJung-uk Kim=head1 SEE ALSO 68e71b7053SJung-uk Kim 69e71b7053SJung-uk KimL<EVP_PKEY_asn1_new(3)>, L<EVP_PKEY_asn1_add0(3)> 70e71b7053SJung-uk Kim 71e71b7053SJung-uk Kim=head1 COPYRIGHT 72e71b7053SJung-uk Kim 73*b077aed3SPierre ProncheryCopyright 2017 The OpenSSL Project Authors. All Rights Reserved. 74e71b7053SJung-uk Kim 75*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 76e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 77e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 78e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 79e71b7053SJung-uk Kim 80e71b7053SJung-uk Kim=cut 81