New function to retrieve ASN1 info on public key algorithms. New command
[openssl.git] / crypto / asn1 / ameth_lib.c
index 3616816c1cc353fbcc186b06f4fb76b5a5c745ad..6f98872cf10baf235966a0c56eb8ffc2a2fdbf22 100644 (file)
@@ -186,6 +186,25 @@ int EVP_PKEY_asn1_add(const EVP_PKEY_ASN1_METHOD *ameth)
        return 1;
        }
 
+int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *ppkey_base_id, int *ppkey_flags,
+                               const char **pinfo, const char **ppem_str,
+                                       const EVP_PKEY_ASN1_METHOD *ameth)
+       {
+       if (!ameth)
+               return 0;
+       if (ppkey_id)
+               *ppkey_id = ameth->pkey_id;
+       if (ppkey_base_id)
+               *ppkey_base_id = ameth->pkey_base_id;
+       if (ppkey_flags)
+               *ppkey_flags = ameth->pkey_flags;
+       if (pinfo)
+               *pinfo = ameth->info;
+       if (ppem_str)
+               *ppem_str = ameth->pem_str;
+       return 1;
+       }
+
 EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id,
                                        const char *pem_str, const char *info)
        {